Best practices

Duffy

18-05-2010 11:46:55

Hey folks,

I managed to get QuickGUI to run and now I just wanted to get some knowledge about the best use of its features.
We are currently building a game for the iPhone.

The Game has multiple states, like Lobby, Play, GameMenu, Exit ..., each with his own ogre scenegraph but all render to the same viewport.
For now I have created a guimanager and sheet for each state, I thought it'll be wise, since those states get created and destroyed a lot.
Is that ok ?

kungfoomasta

18-05-2010 15:54:58

Hi Duffy,

I read your other thread, I'm glad you got your app running. I would suggest just using one GUIManager, and creating a Sheet for each state that you want. Only one sheet can be shown at a time (via GUIManager), and defines they UI Layout of Windows and widgets, and also Mouse Cursor properties.

If you haven't already, I would browse through the few short tutorials I put up on the wiki: http://www.ogre3d.org/wiki/index.php/QuickGUI. Some of them might be a little out of date, but it should give you a rough idea how to utilize the library.

Duffy

18-05-2010 19:20:13

Hey kungfoomasta,

thanks for your suggestions, I managed to create buttons and handle events thanks to your tutorials.
I currently have some trouble switching between states with Ogre, I need to detach the scenemanager somehow, but I have no clue how, yet ;)

Do I need to do something with the GUIManager, when switching through states ? Or can I leave them as they are ?

kungfoomasta

18-05-2010 23:33:30

You only need to let the GUIManager know if the viewport has changed, or if the SceneManager has changed. Other than that, everything will be drawn to the specified viewport in the specified scenemanager whenever normal SceneManager rendering occurs.