Window defined in XML layout not showing up
Posted: Wed Jan 14, 2009 15:14
Hello there!
I've finally come around to switching from hard-coded menu structures to using XML layout files for CEGUI.
For my main menu, this works fine. I have on .layout for each submenu, load these when needed and simply call setGUISheet(...) with the currently needed submenu sheet.
However, one layout doesn't seem to work as expected for me:
When I switch to this layout I only see the two buttons "Accept" and "Back", the rest doesn't show up. I would have expected to see the element "Frame" with all its children at the top edge of my sheet, a whole lot of empty space and the two buttons already mentioned.
I tried fiddling around with the alpha settings (even going back to Alpha = 1 for all elements), but no success.
The code used for loading and displaying is pretty straight-forward:
That's it. FinishGUI() does nothing to change visibility of the elements, btw.
The CEGUI log and the Ogre log don't show any errors, I don't get any exceptions and all the elements from the layout I access in FinishGUI seem to be fine.
Does anybody see the issue here?
PS: I'm using CEGUI 0.51 together with Ogre 1.6
[edit]
Replaced the large layout with a smaller example (the layout for the next menu, actually). The result is the same: The two buttons are visible, the StaticText element isn't.
I've finally come around to switching from hard-coded menu structures to using XML layout files for CEGUI.
For my main menu, this works fine. I have on .layout for each submenu, load these when needed and simply call setGUISheet(...) with the currently needed submenu sheet.
However, one layout doesn't seem to work as expected for me:
Code: Select all
<?xml version="1.0" ?>
<GUILayout>
<Window Type="DefaultGUISheet" Name="TankGame/PlayerSetupStateMenu">
<Property Name="InheritsAlpha" Value="false"/>
<Property Name="Alpha" Value="0.0"/>
<Property Name="UnifiedPosition" Value="{{0.001, 0},{0.001, 0}}"/>
<Property Name="UnifiedSize" Value="{{0.999, 0},{0.999, 0}}"/>
<Window Type="TaharezLook/StaticText" Name="TankGame/PlayerSetupStateMenu/Frame">
<Property Name="InheritsAlpha" Value="false" />
<Property Name="Alpha" Value="1.0" />
<Property Name="UnifiedPosition" Value="{{0.03, 0},{0.03, 0}}" />
<Property Name="UnifiedSize" Value="{{0.94, 0}, {0.13, 0}}" />
</Window>
<Window Type="TaharezLook/Button" Name="TankGame/PlayerSetupStateMenu/BackButton">
<Property Name="UnifiedPosition" Value="{{0.1052, 0},{0.8008, 0}}"/>
<Property Name="UnifiedSize" Value="{{0.282, 0},{0.056, 0}}"/>
<Property Name="Text" Value="Back"/>
<Property Name="InheritsAlpha" Value="false"/>
<Property Name="Alpha" Value="1.0"/>
</Window>
<Window Type="TaharezLook/Button" Name="TankGame/PlayerSetupStateMenu/AcceptButton">
<Property Name="UnifiedPosition" Value="{{0.6128, 0},{0.8008, 0}}"/>
<Property Name="UnifiedSize" Value="{{0.282, 0},{0.056, 0}}"/>
<Property Name="Text" Value="Accept"/>
<Property Name="InheritsAlpha" Value="false"/>
<Property Name="Alpha" Value="1.0"/>
</Window>
</Window>
</GUILayout>
When I switch to this layout I only see the two buttons "Accept" and "Back", the rest doesn't show up. I would have expected to see the element "Frame" with all its children at the top edge of my sheet, a whole lot of empty space and the two buttons already mentioned.
I tried fiddling around with the alpha settings (even going back to Alpha = 1 for all elements), but no success.
The code used for loading and displaying is pretty straight-forward:
Code: Select all
using namespace CEGUI;
WindowManager& wndMgr = CEGUI::WindowManager::getSingleton();
try
{
m_pMainWnd = wndMgr.loadWindowLayout("GameSetupState.layout");
}
catch(CEGUI::FileIOException&) {throw;}
catch(CEGUI::InvalidRequestException&) {throw;}
catch(CEGUI::AlreadyExistsException&) {throw;}
FinishGUI(); // subscribes to events, fills comboboxes etc...
CEGUI::System::getSingleton().setGUISheet(m_pMainWnd);
That's it. FinishGUI() does nothing to change visibility of the elements, btw.
The CEGUI log and the Ogre log don't show any errors, I don't get any exceptions and all the elements from the layout I access in FinishGUI seem to be fine.
Does anybody see the issue here?
PS: I'm using CEGUI 0.51 together with Ogre 1.6
[edit]
Replaced the large layout with a smaller example (the layout for the next menu, actually). The result is the same: The two buttons are visible, the StaticText element isn't.