void Sysfont_DrawMoji(const char c, const float x, const float y) {
const int N = c - ' ';
const float offset_tu = (float)(N % 16);
const float offset_tv = (float)(N / 16);
const float SIZE_TU = 1.0f / 16.0f;
const float SIZE_TV = 1.0f / 16.0f;
const COLOR DIF = COLOR_XRGB(255, 255, 255);
static const float POLYGON_SIZE = 20.0f;
SYSFONT sysfont[] = {
{ x, y, 0.0f, 1.0f, DIF, offset_tu*SIZE_TU, offset_tv*SIZE_TV },
{ x + POLYGON_SIZE, y, 0.0f, 1.0f, DIF, (offset_tu + 1)*SIZE_TU, (offset_tv*SIZE_TV) },
{ x + POLYGON_SIZE, y + POLYGON_SIZE, 0.0f, 1.0f, DIF, (offset_tu + 1)*SIZE_TU, (offset_tv + 1)*SIZE_TV },
{ x, y + POLYGON_SIZE, 0.0f, 1.0f, DIF, offset_tu*SIZE_TU, (offset_tv + 1)*SIZE_TV }
};
g_PD3Device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, sysfont, sizeof(SYSFONT));
}
void Sysfont_DrawString(const float x, const float y, const char* str) {
for (int i = 0; str[i] != '\0'; i++) {
Sysfont_DrawMoji(str[i], x + i * POLYGON_SIZE, y);
}
}
Sysfont_DrawString(0.0f, 0.0f, "00000");
if(KEY_INPUT_BACK){
}
教えて下さいお願いします