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 Discussion / One player/ Two Player Menu

Author
Message
psylent letterz
18
Years of Service
User Offline
Joined: 8th Oct 2006
Location:
Posted: 19th May 2007 11:10
I want to make a program that allows the user choose between two buttons. "One Player" or "Two Player"

I want the who thing to be GUI so there should be a backdrop and two button objects.

How can I do this?
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 19th May 2007 14:29
Well, you need to make two object either a box or a plain and texture them with an image that says "1 Player" and another that says "2 player". Position them in 3D space and work out where they are on the 2D screen. If the mouse is clicked and is within one of the buttons it'll go to wichever part of the program it needs to go to. If you want I'll give you a code snippet to work from.


Nothing is impossible...
No really, it is.
psylent letterz
18
Years of Service
User Offline
Joined: 8th Oct 2006
Location:
Posted: 19th May 2007 16:31
that would be great if you could help.

Mostly I just want to find out the commands and how to determine if a "button" is being clicked.
luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 19th May 2007 23:58 Edited at: 19th May 2007 23:58
Check on TDKs menu tutorial and there is code for that already.
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 21st May 2007 18:38 Edited at: 21st May 2007 18:38
TDK's tutorial shows you how to determine whether a botton is being pressed but not in 3D so I'll just post this snippet for you.



The camz# variable changes acording to you display mode. The default display mode is 640 by 480 and that is 400. Another common display mode is 800 by 600. That is 500. If you're using another display mode then ask me and I'll find out for you.


Nothing is impossible...
No really, it is.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st May 2007 20:22
Actually, I've not tried it, but method 3 that I covered in the tutorial (sprites) should work on top of a 3D screen - but as you say, it doesn't actually use 3D objects - if that's what he wants.

TDK_Man

Login to post a reply

Server time is: 2025-05-29 07:20:00
Your offset time is: 2025-05-29 07:20:00