Hi, i'm new to Irrlicht, just started today and I have a basic understanding from playing around. I have a moveable camera moving in a room.
I want to make a menu system so you choose play or exit.
How am I able to do this?
Menu System
There is no single right solution for this as it depends on your game. So just a few ideas...
If it does not matter that the game is still rendered below and you simply want to hide it, then add a large guielement (for example a window) which draws the background. And set the background color to non-tranparent (alpha = 255, it's probably that way by default). So you overdraw the background.
But as you know when you want to be in the game (after you pressed play) and when you want to be in the menu (for example after pressing ESC) you can save that information in some variable.
Lets say every time you are in the game you set the bool variable "InTheGame" to true. Then you can put an "if ( InTheGame )" around your rendercode for the game. For example around smgr->drawAll();. If that variable is not set the scene will now no longer be rendered.
In larger games this can get complexer, but the basic principle will stay the same.
If it does not matter that the game is still rendered below and you simply want to hide it, then add a large guielement (for example a window) which draws the background. And set the background color to non-tranparent (alpha = 255, it's probably that way by default). So you overdraw the background.
But as you know when you want to be in the game (after you pressed play) and when you want to be in the menu (for example after pressing ESC) you can save that information in some variable.
Lets say every time you are in the game you set the bool variable "InTheGame" to true. Then you can put an "if ( InTheGame )" around your rendercode for the game. For example around smgr->drawAll();. If that variable is not set the scene will now no longer be rendered.
In larger games this can get complexer, but the basic principle will stay the same.
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
Hi, some time ago i had a problem with this, since it was only a test program i didnt gave i tmuch tough.... but it would be good to ask now that somebody else asked something related....
i was displaying a mesh... pretty much any mesh... and putting some gui on the screen... the problem was that while using a FPS camera if i had gui being rendered(gui_env->drawall();) even if there was nothing on screen... all hidden... i couldnot use movement arrows..... just mouse ot move the camera... and ... mouse events afect whats goin on in the scene whyle manipulating gui... even if u re not rendering the scene....
Is there a way to solve this problem??
i was displaying a mesh... pretty much any mesh... and putting some gui on the screen... the problem was that while using a FPS camera if i had gui being rendered(gui_env->drawall();) even if there was nothing on screen... all hidden... i couldnot use movement arrows..... just mouse ot move the camera... and ... mouse events afect whats goin on in the scene whyle manipulating gui... even if u re not rendering the scene....
Is there a way to solve this problem??
radiant - not without seeing the corresponding sources.
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
I had a similar problem when I switched from menu to the fps camera...
mouse movement (look around) worked, but the keys didn't !!!
after switching back to the menu I saw all my key strokes logged in an editbox I had placed in the menu !!!
So I also had to set the gui focus to another object when activating the camera...
a gui element holds the focus even if it's invisible !!!
maybe a bug !?!?!
maybe you have a gui element in your menu that has the focus and handles the key strokes !?!?!
mouse movement (look around) worked, but the keys didn't !!!
after switching back to the menu I saw all my key strokes logged in an editbox I had placed in the menu !!!
So I also had to set the gui focus to another object when activating the camera...
a gui element holds the focus even if it's invisible !!!
maybe a bug !?!?!
maybe you have a gui element in your menu that has the focus and handles the key strokes !?!?!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java