Relative Positions not working

weinma

15-07-2010 12:44:19

Hi! I am kind of a noob and played around with Ogre and MyGUI a bit. I'm stuck on the following problem using relative positions, which i don't understand.
Hope that somebody can help.

Following Layouts works fine:

With this layout I can see a 100x100 box

<MyGUI type="Layout">
<Property key="Widget_Caption" value="Login"/>
<Widget type="Widget" skin="Panel" position="100 100 100 100" layer="Back" name="MAIN_PANEL">
<Property key="Widget_Visible" value="true"/>
</Widget>
</MyGUI>


With this layout i can see the Stretched box

<MyGUI type="Layout">
<Property key="Widget_Caption" value="Login"/>
<Widget type="Widget" skin="Panel" position_real="0.0 0.0 1.0 1.0" align="Stretch" layer="Back" name="MAIN_PANEL">
<Property key="Widget_Visible" value="true"/>
</Widget>
</MyGUI>


But as soon as i don't use the stretch allign and only use the real positions i don't see anything, except the mousecursor.
FYI I don't have a parent window i just want to show the panel.


<MyGUI type="Layout">
<Property key="Widget_Caption" value="Login"/>
<Widget type="Widget" skin="Panel" position_real="0.25 0.25 0.5 0.5" layer="Back" name="MAIN_PANEL">
<Property key="Widget_Visible" value="true"/>
</Widget>
</MyGUI>



Thanks in advance!
weinma

pS.: I am using the svn trunk version of mygui

weinma

15-07-2010 22:32:39

Okay.. I found a solution. I created a parent window without a skin (invisible), set the size to the current Viewport of the RenderWindow (pixel coords) and add all the relative layouts to it.
Everything seems to work now.

my.name

16-07-2010 09:31:24

this is normal way.