Skip to main content

History: MyGUI FAQ

Source of version: 4

Copy to clipboard
            {DIV(class="Layout_box2")}__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
{CODE(wrap="1", colors="c++")}mGUI->initialise(your_window, "core.xml", '''your_resource_group''');{CODE}{DIV}

{DIV(class="Layout_box5")}__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.
{CODE(wrap="1", colors="c++")}mGUI->injectFrameEntered(evt.timeSinceLastFrame);{CODE}{DIV}

{DIV(class="Layout_box2")}__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.
{CODE(wrap="1", colors="c++")}mGUI->setSceneManager(mCamera->getSceneManager());{CODE}{DIV}

{DIV(class="Layout_box5")}__Q:__ What function do I have to call so my checkBox actually stays checked after it was clicked?

__A:__ Add eventMouseButtonClick:
{CODE(wrap="1", colors="c++")}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());
}{CODE}
Or just add this two lines to your on click event if you already have it.{DIV}

{DIV(class="Layout_box2")}__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 set the viewport.{DIV}

{DIV(class="Layout_box5")}__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:
{CODE(wrap="1", colors="c++")}(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setActiveViewport(1);{CODE}

The parameter is the index of the viewport in the Ogre render window, and is equal to the return value of {MONO()}Ogre::RenderWindow::getNumViewports(){MONO} 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.{DIV}
        

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