扩展

屏幕字 gamefont

屏幕与世界坐标文字绘制

FontPrint.h · plugin::gamefont

drawing / drawFonts / drawHud 等绘制事件中调用。
FONT_DEFAULT:III 为 0,VC / SA 为 1。

不缩放打印

PrintUnscaled

像素坐标,不做分辨率缩放。

static void PrintUnscaled(const std::string& line, float x, float y, ...);

缩放打印

Print

按 Screen 规则缩放。支持单行、角落对齐、多行。

static void Print(const std::string& line, float x, float y, ...);
static void Print(ScreenSide side, Alignment align, const std::string& line, float x, float y, ...);
static void Print(std::vector<std::string> const& lines, float x, float y, float spacing = 1.0f, ...);

世界坐标打印

PrintAt3d

把世界坐标投影到屏幕再绘制。不在视野内时返回 false

static bool PrintAt3d(CVector const& posn, const std::string& line, float offset_x = 0.0f, float offset_y = 0.0f, ...);

对齐与锚点

enum Alignment { AlignCenter, AlignLeft, AlignRight };
enum ScreenSide { LeftTop, LeftBottom, RightTop, RightBottom };

PrintScreenSide / Alignment 重载配合使用。

On this page