Hey
Hopefully someone can help me.
I'm trying to create a menu screen for my prototype game (just recently started using Irrlicht!)
All im after is a screen that has a background image, and two boxes placed in the centre, one above the other.
One box saying 'Start' and the second 'Exit'
then if exit was selected have it close the whole game program down (drop())
or if start selected (for now) just go into another screen with an exit box that would then close the game program down.
Does anyone have any code that would help me, or a link to a tutorial?
Thanks to anyone that can help
only1skingle
Creating a Menu
-
- Posts: 25
- Joined: Mon Sep 27, 2010 6:51 pm
- Location: United Kingdom
-
- Posts: 25
- Joined: Mon Sep 27, 2010 6:51 pm
- Location: United Kingdom
-
- Posts: 25
- Joined: Mon Sep 27, 2010 6:51 pm
- Location: United Kingdom
right, ive had a look at the tutorial. and the boxes and selecting them is there.
But how would i then close:
a) close the program entirelty from a button selection?
and
b) how would i open another screen? theres a new window in the tutorial, so would i do the same but make the window the screen size i desire? and get the program to close the 1st??
thanks again
But how would i then close:
a) close the program entirelty from a button selection?
and
b) how would i open another screen? theres a new window in the tutorial, so would i do the same but make the window the screen size i desire? and get the program to close the 1st??
thanks again
Give your dialogs one gui-element as parent (can be a window, but can also be a large statictext which is invisible). Then you can call setVisible for that parent element to show/hide a complete dialog.
And to close your application your application can add any bool value in your main-loop to quit. For example the usual main-loop in examples looks like this:
But you can also write:
Then you just have to set "quitThisApp" to true and the main-loop while end.
And to close your application your application can add any bool value in your main-loop to quit. For example the usual main-loop in examples looks like this:
Code: Select all
while(device->run())
Code: Select all
bool quitThisApp = false;
while(device->run() && !quitThisApp)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 25
- Joined: Mon Sep 27, 2010 6:51 pm
- Location: United Kingdom