Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / A simple menu

Author
Message
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 22nd Feb 2005 04:09
Here is a simple but cool 3D menu. Use the arrow keys to scroll the options.

Change the MaxObject variable to set the number of menu objects at the moment this can't be bigger than 24. The variable called Selected will tell you which menu item is currently selected. The idea is to put a texture on each plain to let the user know what that option is. If you need any help using it or have any suggestions then post here.
Feel free to use this code as much as you want but please mention me in the credits.

mathkid
20
Years of Service
User Offline
Joined: 1st Feb 2005
Location: Central Massachusetts
Posted: 22nd Feb 2005 07:01
pretty cool... I got an error with the "move object down" command, but I took out the "down" and made the value negative. Maybe you could even ghost the menu choices that aren't selected...?
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 22nd Feb 2005 19:06
It only works in DBPro.
I'll try and update it later.

squirrel 890
20
Years of Service
User Offline
Joined: 18th Jan 2005
Location: aaaaaaaaaaaaaaaaaaaaa i remeber i forgot
Posted: 24th Feb 2005 05:41
you couold also make it move slwoer so they know what they are on
squirrel 890
20
Years of Service
User Offline
Joined: 18th Jan 2005
Location: aaaaaaaaaaaaaaaaaaaaa i remeber i forgot
Posted: 24th Feb 2005 05:45
nice it relly good
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 24th Feb 2005 07:21
That's nice Andy - I may well end up using this. I took the liberty of adding a variable speed# so people can adjust it easily:



As for extending the concept, how about turning the cylinrical shape of this menu into a spherical shape - for example, like a football, which could be rotated on either x or z axis, and the hexagonal panels are the menu choices, or a planet, where the continents are the menu choices ........


TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 24th Feb 2005 22:24
Thanks. I'll keep inproving it. Good idea Ric. I think Iknow what you mean.

vid1987
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 25th Feb 2005 01:04 Edited at: 25th Feb 2005 01:06
Yes i could use this if i could figure out how to paste images or text onto objects does anybody know how to do that without texturing the whole object with the image??

David
Freddy 007
20
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 25th Feb 2005 02:45
I don't...
But I will certainly use this from now on if you could make it so that it would rotate all the way around so that the two opposite ends would meet.
Like a ferriswheel...

That would be cool.


Check out PanzerGames at: http://www.freewebs.com/panzergames
æ ø å
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 25th Feb 2005 20:28
Yeah. I've already done that. I'll upload the code when I can.

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 26th Feb 2005 04:07
Unfortunately there is a bug in it as you will see when you run it. I'll keep trying to fix it but if someone else does then please post the fixed code.


Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 26th Mar 2005 06:48
I wrote a 3d rotating menu similar to this. You could easily modify that to change the axis of rotation by rolling the camera. You can either click on a menu item to give it focus or use the mouse wheel. Then just click the focused item to select it.

http://forum.thegamecreators.com/?m=forum_view&t=42415&b=6

Cheers,

Cloggy
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 27th Mar 2005 03:05
Yeah I think I saw that. I might give that a try.

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 27th Mar 2005 07:29
Andrew,

Here is my code amended for you.



Change the menuradius and cameradistance variable to suit your needs and obviuosly you can change the menuitem sizes to whatever you need as well.

Up and down arrows move through the items as well as the mousewheel and selecting a menuitem will bring it to the front.

Hope this is useful,

Jason
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 28th Mar 2005 06:52
Thanks. That was the menu I saw a while a go. Jacava, a friend of mine, is making a text based RPG using that menu for all the options so he certainly found it useful!

GZMGames Admin
20
Years of Service
User Offline
Joined: 15th Feb 2005
Location: vermont
Posted: 28th Mar 2005 09:46
hey guys on the first post from andrew neale, how would you add text to those buttons or a background?

Games made with passion
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 29th Mar 2005 06:24
Texture the plains. For a background, make another plain and position it behind the menu plains.

WarGoat
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: Montreal
Posted: 31st Mar 2005 06:10
the only problem is, if you put the texture on the plain, the texture is the same for all plain.

Windows XP,pentium IIII, 1,9 MGZ, 256 mb memory, 128 mb video card ATI Radeon 9200 se s80 'sett squadron back on the assault'
Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 31st Mar 2005 06:42
You texture each plain individually. The For...Next loop to create the plains is just for convenience. If you look at my code earlier I texture each plain with its own individual texture.

Cloggy
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 31st Mar 2005 19:24 Edited at: 31st Mar 2005 19:33
Yep. Cloggy is right.

Ken Tankerous
20
Years of Service
User Offline
Joined: 31st Mar 2005
Location:
Posted: 12th Apr 2005 13:33
Wow . . . Very nice !!! Thanks to both Cloggy and Andrew.

Ken
HowDo
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Apr 2005 03:39
Yeh, Very nice and even rolls around when I use my mouse wheel.


In Space No One can Hear You Scream! (When your comm Line is cut?)
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Apr 2005 04:46
Thanks. Glad it is appreciated.

Login to post a reply

Server time is: 2025-05-18 01:35:07
Your offset time is: 2025-05-18 01:35:07