pierceblaylock
18-08-2008 05:43:31
I'm trying to find a way to keep a widget centered on the screen. Similar problem as described in this thread.
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=7290
I'm not sure if this problem has been solved yet, but I was wondering if it could be solved with two additional anchor options. I would look into adding it myself, but I'm just too new to Ogre and QuickGUI to go down that path just yet.
Basically you could add two new anchoring types called ANCHOR_HORIZONTAL_CENTER and ANCHOR_VERTICAL_CENTER. These would work by ensuring that the widget always stays centered.
For example, ANCHOR_HORIZONTAL_CENTER would set the position of the widget to half the viewport width minus half the widget width. This would then need to be updated whenever the viewport size or widget size changes.
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=7290
I'm not sure if this problem has been solved yet, but I was wondering if it could be solved with two additional anchor options. I would look into adding it myself, but I'm just too new to Ogre and QuickGUI to go down that path just yet.
Basically you could add two new anchoring types called ANCHOR_HORIZONTAL_CENTER and ANCHOR_VERTICAL_CENTER. These would work by ensuring that the widget always stays centered.
For example, ANCHOR_HORIZONTAL_CENTER would set the position of the widget to half the viewport width minus half the widget width. This would then need to be updated whenever the viewport size or widget size changes.