Need help and explanation on creating game Menu..

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
djzmo
Posts: 24
Joined: Sun Jul 20, 2008 3:20 pm
Location: Mercury

Need help and explanation on creating game Menu..

Post by djzmo »

Hi..

I'd like to create a game menu but I don't know how since I was new at Irrlicht.
Well, Something like..
-> Start Game
-> Options
-> Exit Game
I do know how to make the menu itself.
But I don't know how to connect between the menu and the game itself. Well, between 2 script files. (ie. once we clicked Start Game button at the main menu, then it calls the game)
I can't even imagine how the code works..
But I have take a look at the source code of Irrlicht Demo since it has a game menuat the first and a loading screen. But it just makes me much more confused =_=

So, please anyone.. explain me the basic with some code snippets so that I can understand every single line of the code :roll:

Thanks,
Jane.
nannolo
Posts: 27
Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell

Post by nannolo »

Hi
there is a class for manage the GUI enviroment
you can find something very usefull here -> http://irrlicht.sourceforge.net/tut005.html

this is tha api about the GUI enviroment -> http://irrlicht.sourceforge.net/docu/cl ... nment.html
djzmo
Posts: 24
Joined: Sun Jul 20, 2008 3:20 pm
Location: Mercury

Post by djzmo »

nannolo wrote:Hi
there is a class for manage the GUI enviroment
you can find something very usefull here -> http://irrlicht.sourceforge.net/tut005.html

this is tha api about the GUI enviroment -> http://irrlicht.sourceforge.net/docu/cl ... nment.html
Thank you for your quick respond.
But I'm not talking about the GUI.
I have said that I have no problem with creating the menu itself.
What I can't do is to connect between the menu and the game itself..
nannolo
Posts: 27
Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell

Post by nannolo »

ah ok

i made something like this
1. init game ,
2. GUI loop
3. from the loop i get a value , it's the choice about the menu
4. if the choice is "start game" then clear the GUI and start the GAME loop
djzmo
Posts: 24
Joined: Sun Jul 20, 2008 3:20 pm
Location: Mercury

Post by djzmo »

nanoolo wrote:4. if the choice is "start game" then clear the GUI and start the GAME loop
how to do that? (clear the GUI and start another loop)
nannolo
Posts: 27
Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell

Post by nannolo »

I create another class for the menu,
because it was easier to manage the menu that way
after used menu
simply i have a switch like this

Code: Select all

menu.showMenu();
switch (menu.getChoice()){
     case 0: //click on the start button
             core.start();
             break;
     case 1: //click on the option button
             menu.showOption();
             break;
       ----
     etc etc   
}
djzmo wrote:how to do that? (clear the GUI and start another loop)
look at the GUIEnviromenti API
just GUIEnviroment->clear();
Post Reply