Add resizing code for credits

This commit is contained in:
CodingJellyfish 2024-05-03 20:20:03 +08:00
parent e52b2fafdc
commit 26aa328994
2 changed files with 16 additions and 5 deletions

View File

@ -215,16 +215,21 @@ void CreditsScreen::loadedFromFile()
void CreditsScreen::init()
{
Screen::init();
reset();
updateAreaSize();
} // init
// ----------------------------------------------------------------------------
void CreditsScreen::updateAreaSize()
{
Widget* w = getWidget<Widget>("animated_area");
assert(w != NULL);
reset();
setArea(w->m_x + GUIEngine::getFontHeight(),
w->m_y + GUIEngine::getFontHeight() / 2,
w->m_w - GUIEngine::getFontHeight() * 2,
w->m_h - GUIEngine::getFontHeight());
} // init
} // updateAreaSize
// ----------------------------------------------------------------------------

View File

@ -59,7 +59,7 @@ class CreditsScreen : public GUIEngine::Screen,
bool getLineAsWide(std::ifstream& file, core::stringw* out);
bool m_is_victory_music;
void updateAreaSize();
public:
@ -91,6 +91,12 @@ public:
else
return stk_config->m_title_music;
}
virtual void onResize() OVERRIDE
{
Screen::onResize();
updateAreaSize();
}
};
#endif