主页 / 库函数目录 / 文字输出 / ege_outtextxy

功能:

在指定位置输出字符串(使用 ARGB 颜色,由 setcolor() 或 settextcolor() 指定)。

声明:
void ege_outtextxy(
    float x,
    float y,
    const char* text,
    PIMAGE pimg = NULL
);

void ege_outtextxy(
    float x,
    float y,
    CHAR c,
    PIMAGE pimg = NULL
);

void ege_outtextxy(
    float x,
    float y,
    const wchar_t* text,
    PIMAGE pimg = NULL
);

void ege_outtextxy(
    float x,
    float y,
    wchar_t c,
    PIMAGE pimg = NULL
);
参数: x 文本输出位置的 x 坐标(文本实际位置与文本对齐方式、文本倾斜角度等相关)。 y 文本输出位置的 y 坐标(文本实际位置与文本对齐方式、文本倾斜角度等相关)。 text 要输出的文本内容。 c 要输出的字符。 pimg 要输出文本的目标图像(如果为 NULL,则输出到窗口)。 返回值: (无) 示例:
// 示例1:输出固定内容的字符串
const char* s = "Hello World";
ege_outtextxy(10, 20, s);

// 示例2:输出字符
char c = 'A';
ege_outtextxy(10, 40, c);

// 示例3:输出数值,先将数字格式化输出为字符串
char s[32];
snprintf(s, sizeof(s), "value:%d", 1024);
ege_outtextxy(10.0f, 60.5f, s);

// 示例3 可以直接用 ege_xyprintf 代替
ege_xyprintf(10.0f, 60.5f, "value:%d", 1024);