imlucid
07-02-2014 21:31:40
I was following the quick start up tutorial and i was using the tutorial framework.
So i put the header files at the top in BaseApplication.h i also put MyGUI::Gui* mGUI;
in the file.
I put his in the Tutorial application.cpp in the create scene part dont know if it goes there MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneManager); // mWindow is Ogre::RenderWindow*, mSceneManager is Ogre::SceneManager*
mGUI = new MyGUI::Gui();
mGUI->initialise();
does some one have a sample code with the tutorial framework just with a simple button?
imlucid
08-02-2014 20:09:33
Could someone post a small sample like this one here but for mygui
http://www.ogre3d.org/tikiwiki/tiki-ind ... =Tutorials
It would be a lot easier to learn if there was a tutorial like that. It doesn't need to be like what every little thing means i just want it so i have a starting point and than i can learn and play around with everything from there.
Edit: Here is what i have done. In the tutorialframework i include mygui.h and the other include in the basicapplication.h i than added
virtual void myguiSetup();
virtual void command();
MyGUI::Gui* mGUI;
in the baseapplication class
in baseapplication.cpp i added this in myguisetup
void BaseApplication::myguiSetup(void)
{
MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneMgr, "General"); // mWindow is Ogre::RenderWindow*, mSceneManager is Ogre::SceneManager*
mGUI = new MyGUI::Gui();
mGUI->initialise();
MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::Align::Default, "Main");
button->setCaption("exit");
// set callback
button->eventMouseButtonClick += MyGUI::newDelegate(this, &BaseApplication::command);
}
but there is a error with this code here
button->eventMouseButtonClick += MyGUI::newDelegate(this, &BaseApplication::command);
it deals with += and says no operator matches these operands.
That is all i have done so far and in mygui it also says cannot find mygui_core.xml i have the media folder and mygui_media in the general section in resources_d.cfg file
sunflare
16-02-2014 23:32:57
but there is a error with this code here button->eventMouseButtonClick += MyGUI::newDelegate(this, &BaseApplication::command);
it deals with += and says no operator matches these operands.
your function needs to have the right signature. see
http://mygui.info/docs/class_my_g_u_i_1 ... 2de5ca0349
if you change it to
void command(MyGUI::Widget* sender);
this should work.
imlucid
23-02-2014 22:46:52
yeah that worked, so i have been figuring out what the best option for this would be but i wanted a text box with a scroll bar so i decided to go with the edit box. This edit box would be used to tell update information to the user. I set to read only but the cursor still changes so it looks like you can still edit it and i do not want it to show that. I than found the needmousefocus but than the scroll bar doesnt work. how can i stop the cursor from changing from this widget but not others?
scrawl
23-02-2014 23:27:55
You want the "Static" mode, see docs for EditBox:
Static mode is same as read only, but you also can't select text.
This should stop the cursor from changing, too.