Mobile: fix statustext position (again)
This commit is contained in:
parent
32fa295594
commit
b064be3e74
@ -328,6 +328,7 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
||||
core::rect<s32> size(0, 0, e->scale.X, text_height * e->scale.Y);
|
||||
std::wstring text = unescape_enriched(utf8_to_wide(e->text));
|
||||
core::dimension2d<u32> textsize = font->getDimension(text.c_str());
|
||||
if (e->pos.X == 0.5) {
|
||||
v2s32 offset((e->align.X - 1.0) * (textsize.Width / 2),
|
||||
#if defined(__ANDROID__)
|
||||
(e->align.Y - 1.0) * (textsize.Height) * 4);
|
||||
@ -338,6 +339,12 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
||||
#endif
|
||||
v2s32 offs(e->offset.X, e->offset.Y);
|
||||
font->draw(text.c_str(), size + pos + offset + offs, color);
|
||||
} else {
|
||||
v2s32 offset((e->align.X - 1.0) * (textsize.Width / 2),
|
||||
(e->align.Y - 1.0) * (textsize.Height / 2));
|
||||
v2s32 offs(e->offset.X, e->offset.Y);
|
||||
font->draw(text.c_str(), size + pos + offset + offs, color);
|
||||
}
|
||||
break; }
|
||||
case HUD_ELEM_STATBAR: {
|
||||
v2s32 offs(e->offset.X, e->offset.Y);
|
||||
|
Loading…
x
Reference in New Issue
Block a user