How to create good menu-system?

Blitz3D Forums/Blitz3D Programming/How to create good menu-system?

PowerPC603(Posted 2003) [#1]
This may have been asked before, but how can I create a menu-system in Blitz3D?

I'm planning to create a game like Freelancer (or Frontier Elite II), but in the style of Grand Theft Auto 3 (so instead of flying a spaceship, you would be driving a car, van, truck, ...).

But when you go to a site where you could buy/sell items,
a menu should pop-up (loading the menu when the vehicle stops at the shop, I can do this myself), but the menu should display the items icon (like Freelancer), must have a scrollbar to scroll through the itemlist, etc.

How can I do this?

I tested a simple buttonbased menu, just displaying a default bitmap for the button.
And when the mouse got over it (determining the position of the mouse and create a virtual rectangle for overlap-detection), it displayed another bitmap instead.
Then when you clicked, "something" happened.

Is there an easier way to do this?


darklordz(Posted 2003) [#2]
Use 2 "Main" Loops

.Menu
While MenuAction = 0
; Menu StuffHere
; If Hit ExitButton : End etc etc etc
Wend

While Not Keyhit(1)
; Real GameSttuff Here
Wend
Goto Menu


i find it easier to build my game first and the Menu/ Interface Second...


PowerPC603(Posted 2003) [#3]
Yes, I knew that it would require 2 different "main" loops.
I will probably need more than 10 different menu's, so I would use a different function for each of them, which all hold another "main" loop.
And selecting the correct menu can be done using "Select case".

But is there an easier way to create the buttons, the scrollbars, ...?
And also act on them when they are clicked?

Like in Visual Basic:
Button1_Click() ==>> for example.

Because like the way I did it, it was a bit confusing.


Warren(Posted 2003) [#4]
No, there is no built in way to do a user interface. You have to write everything yourself. There are UI libraries around written by other Blitz coders you can use though if you don't want to roll your own.


WolRon(Posted 2003) [#5]
Create your own Button1_Click() function and then use it in every menu you make.


poopla(Posted 2003) [#6]
I doi something like darklordz said. My program update function works off of a variable, if the variable = this value, update the game, if it equals that variable, update the menu, or maybe another variable updates both.

It works well.


Mustang(Posted 2003) [#7]
Try this:

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=chroma10102002153409&comments=no

I used it as a base for my own (new) game menu system for my FPS game... I fixed few bugs and added sounds, default settings, 2D/3D/2D sandwich rendering for example - now it's fully functional GameUI that you can use for setting all the video/ audio/ gameplay/ key options and save/ load those to/ from disk. I will release my full source code (with example gfx + functionality) sometime in the near future.


PowerPC603(Posted 2003) [#8]
Thanks for this great menu system.
I'm sure I will most certainly use this one (updated of course).


Rogue Vector(Posted 2004) [#9]
I appologize for the ressurection of this very old thread, but does anyone have chroma's game menu code (mentioned above).

The link on blitzcoder.com is dead.

Perhaps it could be placed in the code archives?

Regards,

Rogue Vector


Mustang(Posted 2004) [#10]
It's too big to put in the code archives I think... but I'm pretty sure that I did found the original menu package by Chroma few days ago accidentally. I'll check this evening if that was it, and post it (hosting it on my site).


IPete2(Posted 2004) [#11]
You could just ask Chroma himself as...he's back!

:)

IPete2.


poopla(Posted 2004) [#12]
Then wheres our damned airplane game? Chroma? Hmm??? ANSWER!!!


Mustang(Posted 2004) [#13]
Allrighty, here it is at last:

http://www.caffeineoverdose.net/cod/zips/GameMenuSystem_ByChroma.zip

This should be the exact latest stuff from Chroma, just run the GSM-Demo.bb and check the code what it does (it's quite simple) - And don't ask me questions about the code, I didn't wrote it :)

I have done for my own game updated version of this with lots of improvements (and few bug fixes, like the scroll text end flickering), but this is another story.


Rogue Vector(Posted 2004) [#14]
Thanks Mustang.

Regards,

Rogue Vector


Chroma(Posted 2004) [#15]
Bwahaha! Something for me to work on. I'll revamp this and post it in the archives.


Techlord(Posted 2004) [#16]
Chroma,

Your library is very straight forward and easy to use without documentation. A 3D conversion would be a nice revamp.


AdrianT(Posted 2004) [#17]
Depending on what 3d software your using. We just created all the menu in our last game in 3dsmax, and exported a camera with the menu items allready attached. Included rollover states in animated files, and had a hot hidden poly that trigered the buttons. Jeremy simply coded the actions for the buttons and the frames used for different animated button states etc, and that was about it. Worked quite well and was pretty much WYSIWYG

you can check out Market value to see how that worked out.


http://www.leadfootproductions.com/Install-Market-Value-Demo.exe


Chroma(Posted 2004) [#18]
Thanks Frank. I'm hoping to make it even easier to use by making it resemble BlitzPlus a little more. And also add in sound options. So if you put your mouse over the button, it changes to image2 and also plays a click sound or whatnot.


Chroma(Posted 2004) [#19]
Still working on the project. I'm rewriting it from scratch. Hey, it's something to do I guess, at least until I can get started on something worthwhile.


Craig H. Nisbet(Posted 2004) [#20]
Do what I did, cheat! Get Felix's gui system 3dgametool.com It's dirt simple to use and creates a great looking interface that is not too widowsy looking.


Rhyolite(Posted 2004) [#21]
I presume you mean BCF by Filax? Yeah, this is a great GUI, although not as specific to creating a start menu as some of the suggestions above, its more flexible and looks great. Does cost a few pounds though ;)


Chroma(Posted 2004) [#22]
Yeah BCF is more of a tool type menu system. Game Menu System 2 is specifically aimed at in-game menu screens.

Btw Craig, BCF looks *very* windowsy.~ =P


I'm finishing up the Scrollbox (get the hard stuff done first). Should have a download here in a couple days or so.


Edit:
I have a tool menu system I made awhile back call WinBlitz that is an exact replica of windows. If anyone is interested I'll post a link here to it.


Erroneouss(Posted 2004) [#23]
different than winblitz3d?
if it is, okay!
i've got 3 people that have a GUI
called WinBlitz its sooo confusing...
i read an old post while lookin for winblitz3d
and it said Kev made it and now some other guy,
not you, said he made it and he emailed it to me
and now, you say you made winblitz... ahhhhhhhhhh
sooo confusing.....
anyway... okee dokee! post link please!
i'm interested im trying to find very close (or exact
windows representations) for a GUI thanks in advance!


Luke111(Posted 2008) [#24]
Every1--Maplet is a VIRUS!!! Dont download it!!!!! Only for the win32 version


Nate the Great(Posted 2008) [#25]
maplet??? virus??? why did you choose this thread to bring that up in?