Skip to main content

History: MyGUI FAQ

Preview of version: 6

Q: Something works wrong. Why?

A: Check MyGUI.log.

Q: Why when creating any widget I have exception "layer '[any_layer_name]' not found"?


A:

  1. Check that MyGUI_Media folder in resources.cfg
  2. Check that MyGUI_Media folder in default resource group General
    • For loading MyGUI from another resource group write this
Copy to clipboard
mPlatform = new MyGUI::OgrePlatform(); mPlatform->initialise(mWindow, mSceneManager, "MyResourceGroupName");

Q: Why Combobox popup/Tab widget sheets selecting/RenderBox autorotate/Progress bar autotrack/Edit caret blinking/Message doesn't work?


A: All of this happens when you don't call inject every frame.

Copy to clipboard
mGUI->injectFrameEntered(evt.timeSinceLastFrame);
Info Note: This method was removed in MyGUI 3.0 and it is called inside renderer automatically.

Q: Why do the GUI disappears when I change the camera?


A: If a new camera have a new Scene Manager, you need set the GUI on a new Scene Manager.

Copy to clipboard
(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setSceneManager(mCamera->getSceneManager());

Q: What function do I have to call so my checkBox actually stays checked after it was clicked?


A: Add eventMouseButtonClick:

Copy to clipboard
button->eventMouseButtonClick = MyGUI::newDelegate(this, &[class_name]::notifyToggleCheck); void [class_name]::notifyToggleCheck(MyGUI::WidgetPtr _sender) { MyGUI::ButtonPtr checkbox = _sender->castType<MyGUI::Button>(); checkbox->setStateCheck(!checkbox->getStateCheck()); }
Or just add this two lines to your on click event if you already have it.

Q: My code compiles and runs. The logs do not report any problems, but all I see is a blank screen.


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)

Copy to clipboard
(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setSceneManager(mSceneManaer); (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setRenderWindow(mWindow); (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setActiveViewport(index);

Q: My code compiles and runs as in the previous question. My scene displays, but I don't see the GUI


A: If you are using multiple viewports, you need to tell the platform render manager about this:

Copy to clipboard
(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.

History

Information Version
Sat 31 of Aug, 2013 16:25 GMT-0000 scrawl Added hint to enable overlays on the viewport if MyGUI doesn't render 15
Mon 22 of Jul, 2013 10:10 GMT-0000 An00biS Added A: Make sure you init resources before initing gui. 14
Mon 03 of Jun, 2013 17:18 GMT-0000 Altren 13
Mon 03 of Jun, 2013 17:16 GMT-0000 Altren 12
Thu 11 of Aug, 2011 11:15 GMT-0000 Mind Calamity Fixed obsolete checkbox state code. 11
Wed 13 of Oct, 2010 14:23 GMT-0000 Altren 10
Fri 30 of Jul, 2010 14:18 GMT-0000 Altren 9
Thu 17 of Jun, 2010 04:10 GMT-0000 Altren 8
Wed 19 of May, 2010 16:43 GMT-0000 jacmoe 7
Sat 01 of May, 2010 00:18 GMT-0000 jacmoe 6
Sat 01 of May, 2010 00:17 GMT-0000 jacmoe 5
Thu 31 of Dec, 2009 20:47 GMT-0000 jacmoe 4
Thu 31 of Dec, 2009 20:10 GMT-0000 jacmoe 3
Mon 28 of Dec, 2009 05:47 GMT-0000 jacmoe 2
Mon 23 of Nov, 2009 08:50 GMT-0000 Tp 1