[Solved] How to hide the GUI

medo87

16-06-2009 13:42:42

Hi there,

I am trying to show and hide the GUI when I press a keyboard button, and when the GUI is hidden I want the mouse movements to rotate the camera rather than moving the mouse cursor. So far I have managed to hide the cursor but any mouse movements cause the hidden mouse to change position.

Any ideas?
Thanks

Five_stars

16-06-2009 13:53:05

Just save the mouse position when you hide gui and set this saved position to pointer (MyGUI::PointerManager::getInstance().setPosition(MyGUI::IntPoint)).

P.S. And I don't understand. Did you hide gui itself?

stannol

16-06-2009 13:54:14

mouseMoved(const OIS::MouseEvent &event)
{
if(GUIVisible)
{
MyGUIObject->injectMouseMove(event);
}
else
{
// rotate
}
}

medo87

17-06-2009 15:03:33

Sorry for the late reply, and thanks for your replies.
Just save the mouse position when you hide gui and set this saved position to pointer (MyGUI::PointerManager::getInstance().setPosition(MyGUI::IntPoint)).

P.S. And I don't understand. Did you hide gui itself?


No i didn't manage to hide the GUI itself, only the mouse pointer. Is there an API call i can use other than hiding each widget individually?

Thanks for your help

Altren

17-06-2009 15:39:10

Well, you can hide all root widgets and mouse pointer:
MyGUI::EnumeratorWidgetPtr rootWidgets = mGUI->getEnumerator();
while (rootWidgets.next()) {
rootWidgets->setVisible(false);
}

mGUI->hidePointer();

medo87

17-06-2009 16:48:05

Thanks a lot for your help. Managed to get it working.
Medo

my.name

27-06-2009 08:29:26

LayerManager::getInstance().setSceneManager(nullptr);
=)