⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cfont.h

📁 成熟的RPG引擎,Flysky发布. 斜视角引擎.
💻 H
字号:
// |//////////////////////////////梦幻水晶游戏程序 V1.0///////////////////////////////|
// ||     ;;;;;;     ;;         ;;    ;;           ;,;;        ;;    <;     ;;    ;; ||
// ||     ;.         ;;          ;,  ;;           ;,           ,;  ;;        ;,  ;;  ||
// ||     .;;;;;     ,,           ; ;.             ;;          ;.;;           ; ;.   ||
// ||     ;;         ;;            ;.                ;;        .;;;            ;.    ||
// ||     ..         ,,            ,;                ,.        ;;  ;;          ,;    ||
// ||     ;,         ;;;;;;        .,             ;;;,        ;;    <;         .,    ||
// |//////////////////////////////////////////////////////////////////////////////////|
//字体类
//感谢 微软 SoftBoy
#pragma once
#include <windows.h>
#include <ddraw.h>
#include <stdio.h>
class CFont
{
public:
	static DWORD DELAYTICK[10];		//文字出现的延时
	HFONT font_Font;	//字体对象
	int font_Size;		//大小
	char *font_Family;	//字体
	int font_Weight;	//线宽(0-1000)
	int font_Exp;		//字体大小修正值(0-699=0 700-1000=1)
	COLORREF font_Color;	//颜色
	DWORD font_BK;		//字的背景是否镂空
	COLORREF font_BKColor;	//背景色
	int font_Width;		//一行的文字数 中文=width/2
	int font_LineHeight;//行间距
	bool bChangeColor;	//在一段文字中是否可以变换颜色
	int DelayTick;		//在文字依次出现时的延时
	CFont();
	void GetFontInfo(LPDIRECTDRAWSURFACE7 surf,TEXTMETRIC* tm);
	void SetFont(int, char *);		//初始化字体
	void GetFont(int &FontSize,char *&FontType);
	void SetColor(COLORREF);			//设置颜色
	COLORREF GetColor();				//获取颜色
	void SetBK(bool);				//设置字体背景是否镂空
	void Restore_Default_Font();	//恢复缺省字体
	void SetChangeColor(bool);		//设置在一段文字中是否可以变换颜色
	void PrintText(LPDIRECTDRAWSURFACE7,int,int,char *,...);
	void PrintAlphaText(LPDIRECTDRAWSURFACE7 Surf, int x, int y, int alpha, char *Text,...);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -