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
Organising xml files
Moderators: CEGUI MVP, CEGUI Team
You can have multiple/separate layouts loaded into the same GUISheet. It'll just be something like this:
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.
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.
Who is online
Users browsing this forum: No registered users and 6 guests