|
|
@@ -34,7 +34,7 @@ class TextData |
|
|
|
private: |
|
|
|
int font, align, length; |
|
|
|
char *text; |
|
|
|
vec3i pos; |
|
|
|
vec3 pos; |
|
|
|
}; |
|
|
|
|
|
|
|
/* |
|
|
@@ -47,7 +47,7 @@ Text::Text(char const *text, char const *font) |
|
|
|
data->font = Forge::Register(font); |
|
|
|
data->text = text ? strdup(text) : NULL; |
|
|
|
data->length = text ? strlen(text) : 0; |
|
|
|
data->pos = vec3i(0, 0, 0); |
|
|
|
data->pos = vec3(0, 0, 0); |
|
|
|
|
|
|
|
drawgroup = DRAWGROUP_HUD; |
|
|
|
} |
|
|
@@ -70,7 +70,7 @@ void Text::SetInt(int val) |
|
|
|
data->length = strlen(text); |
|
|
|
} |
|
|
|
|
|
|
|
void Text::SetPos(vec3i pos) |
|
|
|
void Text::SetPos(vec3 pos) |
|
|
|
{ |
|
|
|
data->pos = pos; |
|
|
|
} |
|
|
@@ -87,7 +87,7 @@ void Text::TickDraw(float deltams) |
|
|
|
if (data->text) |
|
|
|
{ |
|
|
|
Font *font = Forge::GetFont(data->font); |
|
|
|
vec3i delta = 0; |
|
|
|
vec3 delta = 0; |
|
|
|
if (data->align == ALIGN_RIGHT) |
|
|
|
delta.x -= data->length * font->GetSize().x; |
|
|
|
else if (data->align == ALIGN_CENTER) |
|
|
|