Hi All,
I'm working on a project which is using CEGUI with Ogre and I've run into a little problem. Sorry for the long post, I want to try and give all of the details I can.
What I want to do:
Implement the concept of an overlay GUI. Basically a GUI layout which hovers over the whole screen no matter what state the game is in (like a debug window). This includes hovering over other GUI layouts (menus mostly).
How I'm currently doing it:
CEGUI::System* m_GUISystem;
CEGUI::Window* m_GUIRootSheet;
CEGUI::Window* m_GUIOverlayRoot;
CEGUI::Window* m_GUIMainSheetRoot;
CEGUI::Window* m_overlay;
CEGUI::Window* m_menu;
//GUI system created (left code out to shorten post)
//set up our GUI windows
m_GUIRootSheet = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "root");
m_GUIRootSheet->setDistributesCapturedInputs(true);
//create overlay root
m_GUIOverlayRoot = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "overlayRoot");
m_GUIOverlayRoot->setAlwaysOnTop(true);
m_GUIOverlayRoot->setDistributesCapturedInputs(true);
m_GUIRootSheet->addChildWindow(m_GUIOverlayRoot);
//create main sheet root
m_GUIMainSheetRoot = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "mainSheetRoot");
m_GUIMainSheetRoot->setDistributesCapturedInputs(true);
m_GUIRootSheet->addChildWindow(m_GUIMainSheetRoot);
//add the root to the system
m_GUISystem->setGUISheet(m_GUIRootSheet);
//load and add overlay
m_overlay = CEGUI::WindowManager::getSingleton().loadWindowLayout("DebugOverlay.layout", "DebugOverlay_");
m_GUIOverlayRoot->addChildWindow(m_overlay);
//load and add menu
m_menu = CEGUI::WindowManager::getSingleton().loadWindowLayout("MainMenu.layout", "MainMenu_");
m_GUIMainSheetRoot->addChildWindow(m_menu);
The Problem:
This gives me the visual effect I'm looking for, but it appears that the GUISheet of the Overlay (or perhaps it's m_GUIRootSheet) is sucking up all of the input even if there are no elements to accept it. In otherwords - I can't click on any of the buttons in my MainMenu layout even though I can see them just fine. What am I doing wrong? Is there a better way to implement this, or do I just need to set some flag? I wasn't sure if the setDistributesCapturedInputs was necessary, it doesn't seem to be helping.
I am generally unclear as to which elements suck up inputs and how I can tell them to ignore certain inputs.
Thank you,
Thaedrys
PS: I should also note that if I do not add the overlay in, I still can't click on any of the buttons on my main menu - so I am guessing it is the main root GUISheet that is grabbing input.
Passing Input through Layered GUISheets
Moderators: CEGUI MVP, CEGUI Team
Re: Passing Input through Layered GUISheets
By default, a DefaultWindow take all place on the screen and grab all the input.
I don't know how to pass input through differents layouts yet. But u can try to change the size and the position of the root window of your differents layout. Or perhaps try to use methods that modify z-order.
I don't know how to pass input through differents layouts yet. But u can try to change the size and the position of the root window of your differents layout. Or perhaps try to use methods that modify z-order.
Re: Passing Input through Layered GUISheets
Thanks for the idea. I'll see if resizing or moving will work around the problem for now. I believe that this is the result of a larger issue though, I posted about it in the Developer's Forum.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: Baidu [Spider] and 13 guests

