Alignment issues


27-04-2011 19:55:01


I'm using MyGUI 3.2.0 (I've tried RC1 and SVN 4294). I have a simple layout: a non-resizable window with an horizontal slider bar and a label.

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="Window" skin="Window" position_real="0.00390625 0.00390625 0.489258 0.5" layer="Main">
<Widget type="ScrollBar" skin="SliderH" position="10 30 431 15" align="HStretch Top">
<Property key="Range" value="100"/>
<Widget type="TextBox" skin="TextBox" position="446 25 39 25" align="Right Top">
<Property key="Caption" value="0%"/>
<Property key="TextAlign" value="Right VCenter"/>

Window width is half the screen, so I've set it to position_real (I've been using the LayoutEditor). Scroll bar and label are set using pixel positioning, but alignment is set so stretching the window will keep the label at the top right position, and scroll bar will be resized to keep up with the window.

Inside the editor, things works as expected, i.e. if I resize the window, label keeps at the right and slider resizes as it should. However, when running test mode, Window resizes correctly but label and slider keeps the original size, as if alignment is not being taken into account. Maybe I'm not understanding alignment? But why inside the editor things work as I expect?

Using % positioning for all elements also works, but label and scroll size & position gets messed up when using other resolutions.

Thanks a lot in advance!