MyGUI FAQ        
Print

Q: Something works wrong. Why?

 

A: Check MyGUI.log.

 

Q: Why MyGUI can't find textures?

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
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.

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.

(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:

button->eventMouseButton<x>click = MyGUI::newDelegate(this, &[class_name]::notifyToggleCheck);
 
void [class_name]::notifyToggleCheck(MyGUI::WidgetPtr _sender)
{
    MyGUI::ButtonPtr checkbox = _sender->castType<MyGUI::Button>();
    checkbox-->setStateSelected(!checkbox->getStateSelected());
}
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)

(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:

(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.

Contributors to this page: Mind Calamity816 points  , Tp56 points  , jacmoe133512 points  and Altren595 points  .
Page last modified on Thursday 11 of August, 2011 11:15:13 UTC by Mind Calamity816 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.