Widget with fixed (pixel) size in bottom left corner


23-04-2011 10:06:14

Hey! How would I go about placing a widget (from xml) in the bottom left corner of the screen (at any resolution) but with a fixed pixel size, so it does not resize when I stretch the window but stays in the bottom left corner? I would need some combination of position_real, align and size... In CSS it would be
// CSS example
position: absolute;
right: 10px;
bottom: 10px;
width: 100px;
height: 100px;

Is this possible without coding or do I have to use my windowresized event from ogre?

/edit: Think of a minimap... It should not become bigger only because a player has a bigger screen :D


23-04-2011 11:42:42

We use BaseLayout helper class in such cases, and it read special field from UserData called SnapTo and move widget there. And when widget need to stay on some distance from borders create EmptyPanel and snap it with this property, but place minimap on it with required offset (10 px from bottom and 10 from left)


23-04-2011 12:41:18

Thanks I will have a look at the BaseLayout helper class :D


23-04-2011 14:38:49

I cannot find that class (is it somewhere in the mygui sources?) neither do I find anything about user data. How do I add user data in XML and how do I read it?



23-04-2011 16:46:18

Ok I looked at the MyGUI headers, found out how Userdata works and implemented the BorderSnap thing myself :D