Alessio89
14-04-2014 12:41:40
So I finally managed to get everything to work with MyGUI and ogre.
I can add new widgets via code and work with them.
I then tried to create a layout using the LayoutEditor application. But when I load it via code, it compiles but no GUI is showing.
This is the Layout file:
And this is how I load it:
What am I missing? I'm failry new to Ogre, so maybe I need to setup something else? Thanks for the help
EDIT: Nevermind. I solved it. I was placing the .layout file in the wrong place. Placed it in the $(OGRE_HOME)/media directory and now it shows fine.
I can add new widgets via code and work with them.
I then tried to create a layout using the LayoutEditor application. But when I load it via code, it compiles but no GUI is showing.
This is the Layout file:
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Button" skin="Button" position="464 204 100 100" layer="Main"
name="MyFirstButton">
<Property key="Widget_Caption" value="exit" />
</Widget>
</MyGUI>
And this is how I load it:
/* In BaseApplication.cpp */
mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneMgr);
mGui = new MyGUI::Gui();
mGui->initialise();
/* In my createScene method */
MyGUI::LayoutManager::getInstance().loadLayout("test.layout");
What am I missing? I'm failry new to Ogre, so maybe I need to setup something else? Thanks for the help

EDIT: Nevermind. I solved it. I was placing the .layout file in the wrong place. Placed it in the $(OGRE_HOME)/media directory and now it shows fine.