实体

字体 CFont

游戏内置字绘制与测宽

CFont.h

游戏内置字。画在 drawingEvent。更省事可用 gamefont 扩展

缩放与颜色

SetScale / SetColor / SetAlphaFade
static void SetScale(float w, float h);
static void SetColor(CRGBA color);
static void SetAlphaFade(float alpha);

字体样式与对齐

SetFontStyle / SetOrientation / SetJustify
static void SetFontStyle(short style);
static void SetOrientation(eFontAlignment alignment);
static void SetJustify(bool on);
static void SetCentreSize(float value);
static void SetWrapx(float value);
static void SetProportional(bool on);

阴影与描边

SetDropColor / SetDropShadowPosition / SetEdge
static void SetDropColor(CRGBA color);
static void SetDropShadowPosition(short value);
static void SetEdge(short value);

背景

SetBackground / SetBackgroundColor
static void SetBackground(bool enable, bool includeWrap);
static void SetBackgroundColor(CRGBA color);

打印字符串

PrintString / PrintStringFromBottom
static void PrintString(float x, float y, const char* text);
static void PrintStringFromBottom(float x, float y, const char* text);
static void PrintChar(float x, float y, char character);

测宽与矩形

GetStringWidth / GetTextRect
static float GetStringWidth(const char* string, bool spaces, bool scriptValues = false);
static void GetTextRect(CRect* rect, float x, float y, const char* text);

缓冲

InitPerFrame / RenderFontBuffer

一般引擎已调;自管缓冲时才碰。

static void InitPerFrame();
static void RenderFontBuffer();
static void DrawFonts();

屏幕坐标用 Screen

On this page