OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: MyGUI FAQ
View page
Source of version: 15
(current)
{DIV(class="Layout_box5")}__Q:__ Something works wrong. Why? __A:__ Check __MyGUI.log__.{DIV} {DIV(class="Layout_box2")}__Q:__ Why MyGUI can't find textures? __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++")}mPlatform = new MyGUI::OgrePlatform(); mPlatform->initialise(mWindow, mSceneManager, "MyResourceGroupName");{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} %note% ''Note'': This method was removed in MyGUI 3.0 and it is called inside renderer automatically.{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++")}(MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setSceneManager(newSceneManager);{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->setStateSelected(!checkbox->getStateSelected()); }{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 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) {CODE(wrap="1", colors="c++")} (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setSceneManager(mSceneManaer); (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setRenderWindow(mWindow); (MyGUI::OgrePlatform*)pPlatform->getRenderManagerPtr()->setActiveViewport(index);{CODE} {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 (1):__ 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. __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. {CODE(wrap="1", colors="c++")}Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); // code code code ... MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform(); mPlatform->initialise(ogreRenderWindow, ogreSceneManager); mGUI = new MyGUI::Gui(); mGUI->initialise();{CODE} __A (3): __ Make sure overlays are enabled on your viewport. MyGUI only renders to viewports with overlays enabled. {CODE(wrap="1", colors="c++")}viewport->setOverlaysEnabled(true);{CODE} {DIV}
Search by Tags
Search Wiki by Freetags
Latest Changes
IDE Eclipse
FMOD SoundManager
HDRlib
Building Ogre V2 with CMake
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
...more
Search
Find
Advanced
Search Help
Online Users
138 online users