// Calculate text height using the font
u32 text_height = font->getDimension(L"Random test string").Height;
- v2u32 screensize = driver->getScreenSize();
-
/*
Draw "Loading" screen
*/
// First line of debug text
gui::IGUIStaticText *guitext = guienv->addStaticText(
L"Minetest",
- core::rect<s32>(5, 5, 795, 5+text_height),
+ core::rect<s32>(0, 0, 0, 0),
false, false);
// Second line of debug text
gui::IGUIStaticText *guitext2 = guienv->addStaticText(
L"",
- core::rect<s32>(5, 5+(text_height+5)*1, 795, (5+text_height)*2),
+ core::rect<s32>(0, 0, 0, 0),
false, false);
// At the middle of the screen
// Object infos are shown in this
if(device->run() == false || kill == true)
break;
+ v2u32 screensize = driver->getScreenSize();
+
// Time of frame without fps limit
float busytime;
u32 busytime_u32;
{
guitext->setVisible(false);
}
-
+
+ if (guitext->isVisible())
+ {
+ core::rect<s32> rect(
+ 5,
+ 5,
+ screensize.X,
+ 5 + text_height
+ );
+ guitext->setRelativePosition(rect);
+ }
+
if(show_debug)
{
std::ostringstream os(std::ios_base::binary);
<<")";
guitext2->setText(narrow_to_wide(os.str()).c_str());
guitext2->setVisible(true);
+
+ core::rect<s32> rect(
+ 5,
+ 5 + text_height,
+ screensize.X,
+ 5 + (text_height * 2)
+ );
+ guitext2->setRelativePosition(rect);
}
else
{