Organising xml files

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Organising xml files

Postby sipickles » Tue Jul 15, 2008 15:23

If I have understood it correctly, the best way to manage lots of windows is to have them all in one .layout file, then use setGUIsheet or the visible property to controll which are visible.

My problem is, when I have many many windows, my layout file gets a bit unwieldy.

Is there any way to load a layout as children of an existing window? Then I could make a root with several invisible children each loading a separate layout file.

Thanks

Si

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Postby Jamarr » Tue Jul 15, 2008 16:14

You can have multiple/separate layouts loaded into the same GUISheet. It'll just be something like this:

Code: Select all

CEGUI::Window* pRoot = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "Root");
CEGUI::Window* pWin1 = CEGUI::WindowManager::getSingleton().loadWindowLayout(sWin1);
CEGUI::Window* pWin2 = CEGUI::WindowManager::getSingleton().loadWindowLayout(sWin2);


The important thing to keep in mind is that you cannot load two windows with the same name. If you are using the CELayoutEditor it creates a "Root" window in each layout file, so if you try to load two layout files who both have a window called "Root" it will fail. You can get around this by simply removing/renaming the "Root" window in each layout file. You may also be able to assign a unique prefix to each layout when loading it, though you'll have to track that prefix if you need to access the windows/elements by name later on.

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Tue Jul 15, 2008 18:52

Thanks,

thats great, no big rewrite required! :wink:


Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests