Menu System

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Joe_Oliveri
Posts: 448
Joined: Tue Oct 05, 2004 3:24 am
Location: Boston, MA

Menu System

Post by Joe_Oliveri »

How did you guys do your menu systems? What Image format did you use and how did you code it?
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
ChrML
Posts: 30
Joined: Sun Oct 03, 2004 2:45 pm
Location: Norway

Post by ChrML »

Well, most systems like that are made by using C++'s lovely Object-Oriented-Programming. Have a class called "menu", with a list over pointers to classes called "menuitem", that has functions like menuitem->drawme(IVideoDriver* videodrv), and it knows it's X, and Y position on the screen, and it's text (caption) with private variables, and you have a few inline wrapper functions to set and get those coordinates and caption. If you want to use an image, or if you want to have some sort of algorithm to draw it, is up to you. Using an image is definitly easiest, but you are more or less restricted to one size then. It's all up to you ;). Assuming you know C++ quite well, this shouldn't be a problem. If you are new to C++, then I know (of my earlier experiences), that your code will be both ugly, and slow, hehe :).
djceejay
Posts: 41
Joined: Fri Feb 25, 2005 11:42 am

Post by djceejay »

You could use the GUI? Can you write a skin for it? That is if you want mouse click control.
Otherwise the method ChrML described sounds good. How about writing a new scene node called MenuItem?
djceejay
Studying :: BSc Computer Games Technology :: UK
Joe_Oliveri
Posts: 448
Joined: Tue Oct 05, 2004 3:24 am
Location: Boston, MA

Post by Joe_Oliveri »

Thank you for your replies, However one problem, would calling a scene node would still have my game running behind it. how would you solve this?
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
cartoonit
Posts: 286
Joined: Mon Nov 15, 2004 6:36 pm

Post by cartoonit »

Yeah you can write your own skin for the GUI, as far as running behind, can you not just call the update everytime round in the render loop?? Then just call the relevant draw methods, unless your looking for pausing, which as far as I know, can be awkward to pause irrlicht, I've never tried it myself, however, IrrlichtNX++ has support for it. As far as I know this has been changed in 0.8, as far as I can remember from the change log, but I might have missed it, been a loooong wk....
Joe_Oliveri
Posts: 448
Joined: Tue Oct 05, 2004 3:24 am
Location: Boston, MA

Post by Joe_Oliveri »

Ok thank you every one. I will put your tips to good use. I agree it has been a long week.
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
ChrML
Posts: 30
Joined: Sun Oct 03, 2004 2:45 pm
Location: Norway

Post by ChrML »

You simply let your menuitems draw themselves after the scenemgr has done it's drawings :).
Post Reply