A: Check MyGUI.log.
Q: Why when creating any widget I have exception "layer '[any_layer_name]' not found"?
A:
- Check that MyGUI_Media folder in resources.cfg
- Check that MyGUI_Media folder in default resource group General
- For loading MyGUI from another resource group write this
mPlatform = new MyGUI::OgrePlatform(); mPlatform->initialise(mWindow, mSceneManager, "MyResourceGroupName");
A: All of this happens when you don't call inject every frame.
mGUI->injectFrameEntered(evt.timeSinceLastFrame);

A: If a new camera have a new Scene Manager, you need set the GUI on a new Scene Manager.
(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setSceneManager(newSceneManager);
A: Add eventMouseButtonClick:
button->eventMouseButtonClick = MyGUI::newDelegate(this, &[class_name]::notifyToggleCheck); void [class_name]::notifyToggleCheck(MyGUI::WidgetPtr _sender) { MyGUI::ButtonPtr checkbox = _sender->castType<MyGUI::Button>(); checkbox->setStateSelected(!checkbox->getStateSelected()); }
A: Make sure you either create the scene manager, camera, and viewport before you initialize the ogre platform class. Or you can create it after and then call (with only those parts that wasn't ready an initialisation stage, so if you created Ogre::RenderSystem and Ogre::RenderWindow before you need only set viewport)
(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setSceneManager(mSceneManaer); (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setRenderWindow(mWindow); (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setActiveViewport(index);
A (1): If you are using multiple viewports, you need to tell the platform render manager about this:
(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setActiveViewport(1);
The parameter is the index of the viewport in the Ogre render window, and is equal to the return value of Ogre::RenderWindow::getNumViewports() just before the viewport used for MyGUI is generated. If you generate viewports dynamically, make sure you repeat this with a decremented index after you remove a viewport that was created before the MyGUI viewport.
A (2): Make sure you're initializing MyGUI after you've initialised it's corresponding resource group in Ogre's ResourceManager. Otherwise, the gui will not show up even though MyGUI.log will report that all it's .xml files were found and parsed fine.
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); // code code code ... MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform(); mPlatform->initialise(ogreRenderWindow, ogreSceneManager); mGUI = new MyGUI::Gui(); mGUI->initialise();
A (3): Make sure overlays are enabled on your viewport. MyGUI only renders to viewports with overlays enabled.
viewport->setOverlaysEnabled(true);