Does mygui work with the new Ogre 1.7 ?
Any sample for how to use it in the sample generated with the 1.7 AppWizard ?
Are there any prebuilt SDK or do i have to download the sources (+dependencies) and build them myself?
I could compile and link MyGUI properly to my 1.7 Test App.
Now i've the problem that at runtime its missing core.xml.
Which files supposed to be in the path for MyGUI?
I place "resources.xml" in /bin which content point to MyGui-Media and MyGUI_Media.
You need copy of MyGUI_Media folder and add path to it into your resources.cfg or whatever you use for Ogre paths. You don't need resources.xml - it is used by demos only.
I added this:
to resources_d.cfg in bin folder.
The above path is valid.
But still didn't work, gets an exception:
"OGRE_EXCEPTION(5:ItemIdentityException): Cannot locate a resource group called " for resource 'core.xml' in ResourceGroupManager::openResource at
..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 685)
If it is not in [General] resource group you should either move it there or add group name when initialising OgrePlatform
Thx, it worked now.
(i forgot to call mPlatform->initialise(...) )
One more question
In my "app" i plan to have different "pages" (logic + own gui) which can be run at the same time.
Should each page have its own Gui object (and platform too?) or should i have one "global" Gui (+platform) object and the gui on each page will be "child" of this object?
If the 2nd way, is it possible to have logical gui-parts so they can be part of a whole gui?
do you have any idea?
You don't need many MyGUI instances (and you actually you can't, since most of them is singletons).
What we usually do is having layout or set of layouts for each "page". Usually each layout is wrapped with BaseLayout class (it used in most demos and tools) and resulting class contain pointers to all layout's widgets and all related to layout logic.
So each wrapped layout is instances that doesn't depend on other GUI parts.
Look at Demo_Colour as an example: there we have EditPanel and ColourPanel. As you can see this two classes represent two windows (each have it's own layout) and all related logic is inside those classes. And they are completely independent.
[Edit: yay, I got 500 posts
Thx, i will use layouts.
Right now i am doing the following init order:
createScence(...) -> creating light, camera and viewport
With the above init order no widgets are shown ! If i call "createScene()" before platform and gui initialisation then it works.
So my question: does mygui need the camera or viewport created before?
( this has also something to do with the question of this guy:
which was never answered
To sum it together: Is it possible to have mygui working with several RenderWindows ? I may have one or more viewports showing different parts of the world (using different cameras) and want to have (party) gui-widgets shown on them.
thx in advance
BTW: did i mention that mygui is great?
Thx again for your answer.
Just to for my understanding:
Having the gui working over multipile viewports isn't possible, right?
anyone knows if mygui will work on multipile viewports?
Well, after reading through the docs and forum, i believe the only solution to my problem is one could use multipile mygui instances (different gui-objects for different viewports).
Can anyone confirm this ?
MyGUI is rendered into one viewport and also ant layer can be rendered into texture (and use that texture anywhere). It's not possible to create two instances of Gui. Actually I believe that it's not necessary to render MyGUI in several viewports.
So the "game window" should be rendered into a texture ? Is there a performance hit for this? And doesn't need the texture be power of 2 ?
I wonder because that what i want to achieve is a very general "thing": having gui on whole screen and somewhere (usually in the middle) the render window,
And maybe even more "viewports", e.g. minimap where one also need to push some buttons.
So i wonder how people handle all these with one GUI instance.
This is not separate viewports at all. You simply creating new windows. And for minimap you generate minimp itself (any way you want - with rtt or whatever, this is not gui part) and then setting texture that you got into StaticImage by setImageTexture.
So in your case no additional viewports required.
By "new windows" you mean RenderWindow oder mygui-windows ?
I probably misunderstood you a bit, but anyway let's say you need gui everywhere and in center - 3d view. You should do next thing: render your 3d view into texture (RTT), then assign texture that you got to StaticImage that is in the middle (or wherever) of your screen.
The problem with this method will be that my 3D-window needs to have size of power of 2 or ?
Also, will there be a performance penalty for using rtt ?
Texture should have power of two size size, but don't need to use whole texture if you don't want to. Also you can scale or crop it.
And about penalty of rtt. This is question for Ogre developers, but I don't understand what you compare with.
First thx for your answers.
What i want to do is nothing unusall, so i was wondering that i've to use rtt. I was thinking there was some "layer" above the viewports in which the gui could write.
One way i was also thinking is to have the 2 viewports and draw my own mouse cursor in the 2nd (game) viewport.
Actually the RenderBox demo coming with mygui does almost the job. Is it possible get window's title and frame hidden? If yes, then i could use this instead or ?
Actually the RenderBox demo coming with mygui does almost the job. Is it possible get window's title and frame hidden? If yes, then i could use this instead or ?There is Window and widget that show viewport. And you simply need that widget without Window, so don't create it and that's all.
thx, i will try this
(is this method something you would also prefer?)
"There is Window and widget that show viewport. And you simply need that widget without Window, so don't create it and that's all."
What do you mean with "widget that show viewport" ? RenderBox ? If so, RenderBox requires window !
I have some more questions:
- is there a manual which explains the widgets in more details ?
- what is the relation between wraps::RenderBox and MyGUI::RenderBox ?
- i created a canvas (MyGUII::createWidget) but it wasn't shown on screen. By creating it through MyGUI::Window it was visible! Why ?
thx in advance for answering the questions!
- is there a manual which explains the widgets in more details ?No. Try to play with widgets in LayoutEditor. Also see where they used in demos.
- what is the relation between wraps::RenderBox and MyGUI::RenderBox ?RenderBox is deprecated and was kept for backward capability. This is actually Canvas
typedef Canvas RenderBox;
- i created a canvas (MyGUII::createWidget) but it wasn't shown on screen. By creating it through MyGUI::Window it was visible! Why ?Well, I'm not sure what are you doing, but visual representation doesn't depend on if widget have parent or not. You probably missed something.
This code works:
const MyGUI::IntSize& size = getGUI()->getViewSize();
MyGUI::Window* window = getGUI()->createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(10, size.height - 10 - 230, 300, 230), MyGUI::Align::Default, "Overlapped");
MyGUI::Canvas* canvas = window->createWidget<MyGUI::Canvas>("Canvas", MyGUI::IntCoord(0, 0, window->getClientCoord().width, window->getClientCoord().height), MyGUI::Align::Stretch);
But this doesn't work (i eliminated the window): the canvas isn't shown!
const MyGUI::IntSize& size = getGUI()->getViewSize();
MyGUI::Canvas* canvas = getGUI()->createWidget<MyGUI::Canvas>("Canvas", MyGUI::IntCoord(10, size.height - 10 - 230, 300, 230), MyGUI::Align::Stretch, "MyCanvas");
In second case you use m_camera instead of getCamera() and not calling gRenderBox.setBackgroundColour(MyGUI::Colour::Black);.
So reason is definitely not in window.
Sorry, i just looked up.
In the 1st version i also use m_camera.
And in the 2nd version i called setBackgroundColour(...).
So camera and backgroundcolour are the same, but the 2nd version still doesn't show up!
You attached Canvas to "MyCanvas" layer that doesn't exist. Look at MyGUI.log when encountering wrong behaviour.
Q: Something works wrong. Why?
A: Check MyGUI.log.
That solved the problem. I used "Overlapped" instead.
Many thx for your help
I will now leave you in peace
(one more question
Is it possible to turn off Window-title? Is it possible to have Window-title but not being able to move the Window?
If not, do you plan these for future versions?