diff --git a/src/font.cpp b/src/font.cpp index a30c9c0b..5eb975dd 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -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; } }