|
|
@@ -69,13 +69,19 @@ char const *Font::GetName() |
|
|
|
|
|
|
|
void Font::Print(vec3 pos, char const *str, vec2 scale) |
|
|
|
{ |
|
|
|
int origin_x = pos.x; |
|
|
|
while (*str) |
|
|
|
{ |
|
|
|
uint32_t ch = (uint8_t)*str++; |
|
|
|
|
|
|
|
if (ch != ' ') |
|
|
|
if(ch == '\n') |
|
|
|
{ |
|
|
|
pos.x = origin_x; |
|
|
|
pos.y-=data->size.y * scale.y; |
|
|
|
continue; |
|
|
|
}else if (ch != ' '){ |
|
|
|
g_scene->AddTile(data->tileset, ch & 255, pos, 0, scale); |
|
|
|
|
|
|
|
} |
|
|
|
pos.x += data->size.x * scale.x; |
|
|
|
} |
|
|
|
} |
|
|
|