I've recently started looking at CEGUI and have run into a problem. I am confused as to why the following code performs like it does.
Code: Select all
<?xml version="1.0" ?>
<GUILayout>
<Window Type="DefaultWindow" Name="root">
<Window Type="WindowsLook/FrameWindow" Name="testWindow">
<Property Name="Position" Value="x:0 y:0" />
<Property Name="AbsoluteHeight" Value="150" />
<Property Name="AbsoluteWidth" Value="320" />
<Property Name="Text" Value="Object Totals" />
<Window Type="WindowsLook/StaticText" Name="CrateTotal" >
<Property Name="BackgroundColours" Value="tl:00DFDFDF tr:00DFDFDF bl:00DFDFDF br:00DFDFDF" />
<Property Name="Font" Value="Tahoma-12" />
<Property Name="FrameEnabled" Value="false" />
<Property Name="InheritsAlpha" Value="false" />
<Property Name="ClippedByParent" Value="true" />
<Property Name="Text" Value="test text" />
<Property Name="TextColours" Value="tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000" />
<Property Name="UnifiedAreaRect" Value="{{0,100},{0, 20},{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="StaticText.000" >
<Property Name="BackgroundColours" Value="tl:00DFDFDF tr:00DFDFDF bl:00DFDFDF br:00DFDFDF" />
<Property Name="Font" Value="Tahoma-12" />
<Property Name="FrameEnabled" Value="false" />
<Property Name="InheritsAlpha" Value="false" />
<Property Name="ClippedByParent" Value="true" />
<Property Name="Text" Value="Crates:" />
<Property Name="TextColours" Value="tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000" />
<Property Name="UnifiedAreaRect" Value="{{0,10},{1, -200},{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="SphereTotal" >
<Property Name="BackgroundColours" Value="tl:00DFDFDF tr:00DFDFDF bl:00DFDFDF br:00DFDFDF" />
<Property Name="Font" Value="Tahoma-12" />
<Property Name="FrameEnabled" Value="false" />
<Property Name="InheritsAlpha" Value="false" />
<Property Name="ClippedByParent" Value="true" />
<Property Name="Text" Value="test text" />
<Property Name="TextColours" Value="tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000" />
<Property Name="UnifiedAreaRect" Value="{{0,100},{1, -160},{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="StaticText.001" >
<Property Name="BackgroundColours" Value="tl:00DFDFDF tr:00DFDFDF bl:00DFDFDF br:00DFDFDF" />
<Property Name="Font" Value="Tahoma-12" />
<Property Name="FrameEnabled" Value="false" />
<Property Name="InheritsAlpha" Value="false" />
<Property Name="ClippedByParent" Value="true" />
<Property Name="Text" Value="Spheres:" />
<Property Name="TextColours" Value="tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000" />
<Property Name="UnifiedAreaRect" Value="{{0,10},{1, -160},{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="CylinderTotal" >
<Property Name="BackgroundColours" Value="tl:00DFDFDF tr:00DFDFDF bl:00DFDFDF br:00DFDFDF" />
<Property Name="Font" Value="Tahoma-12" />
<Property Name="FrameEnabled" Value="false" />
<Property Name="InheritsAlpha" Value="false" />
<Property Name="ClippedByParent" Value="true" />
<Property Name="Text" Value="test text" />
<Property Name="TextColours" Value="tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000" />
<Property Name="UnifiedAreaRect" Value="{{0,100},{1, -120},{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="StaticText.002" >
<Property Name="BackgroundColours" Value="tl:00DFDFDF tr:00DFDFDF bl:00DFDFDF br:00DFDFDF" />
<Property Name="Font" Value="Tahoma-12" />
<Property Name="FrameEnabled" Value="false" />
<Property Name="InheritsAlpha" Value="false" />
<Property Name="ClippedByParent" Value="true" />
<Property Name="Text" Value="Cylinders:" />
<Property Name="TextColours" Value="tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000" />
<Property Name="UnifiedAreaRect" Value="{{0,10},{1, -120},{1,0},{1,0}}" />
</Window>
</Window>
</Window>
</GUILayout>
The code puts the text, "test text" in the upper left hand corner. However, the document describing how to use the UnifiedAreaRect property states that the first of the two values in the curly braces represents the scale factor, and the other represents the pixel count.
What is confusing is that the absolute height of the window is set to 150. Why, then, is the text visible at all? It is supposed to appear 200 pixels above the bottom of the window (or 50 pixels above the window itself).
Calculation: (scale factor * window height) - pixel offset
or (1 * 150) + (-200) = -50
Even more perplexing is that a scale factor of 0 and a height of 10
Code: Select all
<Property Name="UnifiedAreaRect" Value="{{0,10},{0, 10},{1,0},{1,0}}" />
puts the text in the middle of the screen vertically, not at (10, 10) as would be expected. Again, the x component is correct.
Perhaps I'm missing something obvious. But it is strange that it works in the x dimension one way, and the y dimension a completely different way.
Is this a bug, or am I doing something wrong?
Thanks,
Brian