Frader
30-12-2009 02:23:27
I'll start by explaining what i'm doing. I'm using MyGUI 2.2.3. I have a backgroung image that should take the whole screen. Then i have a few panels that are childs of that background StaticImage widged. Those panels should be centered on the screen and keep a defined distance to the bottom.
So I started by defining the background size as a percentage "0 0 100 100" and it's alignment to "Stretch". Afterwards I set the panels align to "HCenter Bottom". The big surprise arrived when I started changing the window's size. The panels kept centered, but their Y position wasn't affected at all. So I kept wondering what the hell that "Bottom" meant... It seemed not to be having any effect at all.
After a good while of playing with the alignment settings and stuff I figured a way to get the results I wanted. The problem is it looks kinda weird. I ended up setting the background's image size in pixels and calling this code after loading the layout:
So, setting the background's image in pixels allows their childs to align properly, but doing it in with percentages does not. What am I doing wrong? Is this thing as bugged as it seems?
So I started by defining the background size as a percentage "0 0 100 100" and it's alignment to "Stretch". Afterwards I set the panels align to "HCenter Bottom". The big surprise arrived when I started changing the window's size. The panels kept centered, but their Y position wasn't affected at all. So I kept wondering what the hell that "Bottom" meant... It seemed not to be having any effect at all.
After a good while of playing with the alignment settings and stuff I figured a way to get the results I wanted. The problem is it looks kinda weird. I ended up setting the background's image size in pixels and calling this code after loading the layout:
mGUI->findWidgetT("MainMenu")->setSize(mWindow->getWidth(), mWindow->getHeight());
So, setting the background's image in pixels allows their childs to align properly, but doing it in with percentages does not. What am I doing wrong? Is this thing as bugged as it seems?