Need your valuable help to create a Button in OGRE by myGUI

nidhin09

17-03-2010 13:11:18

Dear friends,

I am a new guy in MYGUI forum.I have a doubt. please help me with it.
I have configured myGUI 3.0 in my system.I want to use the myGUI controls in my application.
I have set all the configuration requirements as per the instructions.
1. The resources.cfg updation.
2. MyGUI path settings in Ogre application etc.

My Question:
A) In my OGRE project, I have checked the following method to create a button manually,
worked well but appeared like a caption. :cry:


mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneMgr);
mGUI = new MyGUI::Gui();
mGUI->initialise(mResourceFileName);
mInfo = new diagnostic::StatisticInfo();

MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button",30, 40, 300, 26, MyGUI::Align::Default,"B1");
button->setCaption("FirstButton");
button->setVisible(true);


B) I ran the myGUI layout editor project and created a single button.Saved it as button.layout.

MyGUI::LayoutManager::getInstance().load("button1.layout");
MyGUI::ButtonPtr button2 = mGUI->findWidget<MyGUI::Button>("button1");
button2->setCaption("button2");
button2->setVisible(true);


C) Then I tried to load it as,
but simply a caption appeared.That's all.

How can I create an interactive button in my OGRE RENDER window using MyGUI?


Thank you ,
Nidhin

Altren

17-03-2010 14:24:57

Look in MyGUI.log and you will see problem. You need to create it on valid layer.

By the way, you don't need to callbutton2->setVisible(true);widgets is visible by default.