razali2k5
14-05-2010 22:44:18
The game I am working on has several different "states" (as part of a Finite State Automaton). Transitions between states are controlled via a Game Manager whose internal structure is simply a stack. For example, pressing "Play" in the MenuState would pop a PlayState on the stack. Anyway, I am having trouble integrating MyGUI into this architecture.
When I was using QuickGUI, I basically created a new QuickGUIManager in each state I wanted to display GUI components. However, this idea doesn't work well with MyGUI.
In my MenuState, this is how I initialize GUI:
Adding the above code to the PlayState does not work. I have tried this approach for PlayState:
How can I integrate MyGUI so I can have different GUI layouts loaded and displayed depending on the state? I do not want to do any manual hiding of windows. I just want to have something equivalent to having different GUI managers working so each can display its own thing whenever in its state.
When I was using QuickGUI, I basically created a new QuickGUIManager in each state I wanted to display GUI components. However, this idea doesn't work well with MyGUI.
In my MenuState, this is how I initialize GUI:
mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mRoot->getAutoCreatedWindow(), mSceneMgr, "General", getWriteDir()+"\\MyGUI.log");
mGUI = new MyGUI::Gui();
mGUI->initialise("core.xml",getWriteDir()+"\\MyGUI.log");
Adding the above code to the PlayState does not work. I have tried this approach for PlayState:
MyGUI::OgreRenderManager * renderManager = MyGUI::OgreRenderManager::getInstancePtr();
renderManager->setRenderWindow(mWindow);
renderManager->setSceneManager(mSceneMgr);
How can I integrate MyGUI so I can have different GUI layouts loaded and displayed depending on the state? I do not want to do any manual hiding of windows. I just want to have something equivalent to having different GUI managers working so each can display its own thing whenever in its state.