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.

Newcomers DBPro Corner / Game Interfaces, Menus, Etc...

Author
Message
Sharlenwar
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 9th Mar 2009 05:55
I was poking around trying to find some tutorials about making some huds, or an in-game menu, even a screen with options as Start Game, etc.

Any tutorials in the right direction would be great. I've been trying to cruise the forums to find some. Any ideas?
SAAB Driver
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 10th Mar 2009 01:02
There should be plenty of tuturials about making just what you looking for, in the forum, also search the codebase. I know there is some complete guides in the forum.

found this in the codebase:



Good luck!

Hello!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 11th Mar 2009 04:20 Edited at: 11th Mar 2009 04:21
That looks overly complicated .

HUDs are fairly easy. Just make a sprite out of the HUD background image and stick it where you want it on the screen. Put the information for the HUD on seperate sprites and position them appropriately. When the information changes, just revise the sprite's image.

For a game startup menu, try something like this pseudocode:





AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 11th Mar 2009 23:46
Here's some functions for a simple menu:



Just add that as another source file to your project and use the functions like so:



It's might be a little complicated for you, so if you have any questions feel free to ask. Just call InitMenu() with:

-The width of the options/buttons.
-The height of an button.
-The text size.
-The text font.

Then add options with AddMenuOption() using the following:

-The text on the option.
-The color of the option.
-The color of the option when the mouse is over it.
-The color of the border of the option.
-The color of the text.

It will return the ID of the option. And the colors don't have to be in hex, you can just call RGB() like usual.

Then just call UpdateMenu() in your main loop and use OptionSelected() passing the option you're checking for as the parameter.

Sharlenwar
15
Years of Service
User Offline
Joined: 4th Mar 2009
Location:
Posted: 13th Mar 2009 05:27
Yeah, with the functions it does get a bit complex. But these examples are exactly what I'm looking for. Thanks!

Login to post a reply

Server time is: 2024-09-28 02:32:40
Your offset time is: 2024-09-28 02:32:40