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.

DarkBASIC Professional Discussion / making a simple menu

Author
Message
younis12
16
Years of Service
User Offline
Joined: 23rd Feb 2010
Location:
Posted: 5th Feb 2011 13:58
hi
how i can make a simple in game menu with choices like (start game , quit .... etc) ?

i want the code for one choice only so i can understand it and make the second choice by my self
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Feb 2011 14:45 Edited at: 5th Feb 2011 14:51
This is some old code from the age of the dinosaurs, it's very basic one, the real one is far better.However it's impossible to show you the real working code because i have no time to rip it out from my project.


Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Feb 2011 14:46
BTN_1.png

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Feb 2011 14:47 Edited at: 5th Feb 2011 14:47
BTN_2.png

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Feb 2011 14:48
BTN_3.png

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Feb 2011 14:48
BTN_4.png

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 5th Feb 2011 14:49
Well, there are many ways to do this. I use BlueGUI for the initial construction. It will look like a basic windows interface. You could simply replace the graphics.

You could also build a scene of 3D objects and code in the function that when the mouse collides and mouse is pressed another function will start.

I know this is not the answer you might expect because there are way to many approaches to this. Do a search on these boards and some examples will show up. Good luck.

Regards Sph!nx
http://www.mental-image.net
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Feb 2011 14:52
Yeah i just showed him mouse collide thing.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
younis12
16
Years of Service
User Offline
Joined: 23rd Feb 2010
Location:
Posted: 5th Feb 2011 14:53
thanks

you have helped me more than i asked
thanks again
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 6th Feb 2011 06:31
In case you need to do 2D menu using sprites, the easiest way to do that is by applying 1x1 sprite to mouse position and hide it.Then you need only to check for collision between menu sprite and mouse sprite, don't bother with x,y start-end positions of menu items.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!

Login to post a reply

Server time is: 2026-07-18 23:15:56
Your offset time is: 2026-07-18 23:15:56