Building/Switching menus, best practises

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
LittleGiant
Posts: 15
Joined: Wed Jun 02, 2004 1:53 am

Building/Switching menus, best practises

Post by LittleGiant »

Alright, essentially i'm looking to figure out the best way to do things.

Say i have a main menu then a character menu then game, so whats the best way to switch between them?

Should i add all then remove all before i switch betwwen any of the differnt states... if so is there an easy way to do this?

Or should i just be hidding all the unused elements? (seems like unneeded overhead especially during game running)
LittleGiant
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

As far as I understand when something isn't visable it's not being drawn..

I imagine even though it's not being drawn there is something going on in the background but unless you're programming for a 333mhz computer I think you'll be ok.

Not to sound like a (insert swear word here) but I'm pretty sure this is what game collage would teach you. and since I havent gone to collage I wouldn't have a clue personally.

however I believe niko has and his example of switching through "menu's" using different classes like in the techdemo seems to work very well and be the best way.

anyone care to prove me wrong? be my guest I'd like to know the answer to this question my"uneducated"self.

Now that I think about it I'm not even sure niko wrote the techdemo.
One thing I've learned from working with Irrlicht and other projects is how little the people that usually end up helping you know themselfs.

O well I trust someone with more experience will give there 2 cents and make me look a fool but it's all good... it takes all kinds.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

*shameless self plug*
easy answer is to take a look at ICE 3.0 8)
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=6297
a screen cap is worth 0x100000 DWORDS
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

ice is the worst example of using the "Best" scene switching with "low" resource.. since it's a whole addon for irrlicht.

however he is right it would be a good reference to copy from and to make project specific.
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

The techdemo uses a whole separate (software) device for the menu. It creates a new one for the actual demo.

A good idea would be to create an invisible (transparent) gui element (e.g. GUITab) for each menu and place the elements on them (make them children). You only need to switch visibility of those tabs then.

Regarding overhead, it will be one call to each invisible tab that returns immediately because of the invisibility. The child elements will not even be looked at. So no deal.
It is like it is. And because it is like it is, things are like they are.
Post Reply