Add resizing code for credits
This commit is contained in:
parent
e52b2fafdc
commit
26aa328994
@ -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
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user