Add resizing code for credits
This commit is contained in:
parent
e52b2fafdc
commit
26aa328994
@ -215,16 +215,21 @@ void CreditsScreen::loadedFromFile()
|
|||||||
void CreditsScreen::init()
|
void CreditsScreen::init()
|
||||||
{
|
{
|
||||||
Screen::init();
|
Screen::init();
|
||||||
|
reset();
|
||||||
|
updateAreaSize();
|
||||||
|
} // init
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void CreditsScreen::updateAreaSize()
|
||||||
|
{
|
||||||
Widget* w = getWidget<Widget>("animated_area");
|
Widget* w = getWidget<Widget>("animated_area");
|
||||||
assert(w != NULL);
|
assert(w != NULL);
|
||||||
|
|
||||||
reset();
|
|
||||||
|
|
||||||
setArea(w->m_x + GUIEngine::getFontHeight(),
|
setArea(w->m_x + GUIEngine::getFontHeight(),
|
||||||
w->m_y + GUIEngine::getFontHeight() / 2,
|
w->m_y + GUIEngine::getFontHeight() / 2,
|
||||||
w->m_w - GUIEngine::getFontHeight() * 2,
|
w->m_w - GUIEngine::getFontHeight() * 2,
|
||||||
w->m_h - GUIEngine::getFontHeight());
|
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 getLineAsWide(std::ifstream& file, core::stringw* out);
|
||||||
|
|
||||||
bool m_is_victory_music;
|
bool m_is_victory_music;
|
||||||
|
void updateAreaSize();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
@ -91,6 +91,12 @@ public:
|
|||||||
else
|
else
|
||||||
return stk_config->m_title_music;
|
return stk_config->m_title_music;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void onResize() OVERRIDE
|
||||||
|
{
|
||||||
|
Screen::onResize();
|
||||||
|
updateAreaSize();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user