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 / Make my menu working!

Author
Message
Xenosis
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location:
Posted: 27th Jun 2003 03:40
Hey i've maded a small menu for my little game but how do i get to buttons to work?

Right now i have a .dba file for the menu and a other for the game..

Whould it be posibel to make it so when someone presses "start game" will there come a preloader that loads the other file until it's ready and starts it..


Hope you understand what am asking for...
Xenosis
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location:
Posted: 27th Jun 2003 05:24
No one that can help me?

Uriel The Ignoble
21
Years of Service
User Offline
Joined: 13th Jun 2003
Location: In a tiny box in the attic
Posted: 27th Jun 2003 05:54
1st you have to make a button using some sort of paint program
then youd have to load it and position it onscreen
then you have to find where on screen the button is, add
print mousex()
print mousey()
and then move your mouse around to find out the coordinates of the button.. then in your code see if the mouse is positioned within those coordinates.. and if it is, and you click, then the game loads or whatever..
something like this might work..
check every corner of the box to see where it is.. pretend it exists at.. (0,0) (0,2) (2,0) and (2,2) even tho then it would be a tiny tiny square ^.^
anywayz..
if mousex() > 0 and mousex() < 2 and mousey() > 0 and mousey() < 2 and mouseclick = 1 then print "blahdeblah"

i hope that makes since.. in this case if you clicked in the tiny box, the screen would print "blahdeblah" on it and u would know its working


but if your just starting a game, you probally shouldn't start with the User interface like that.. that should probally come last..
altho im relatively new to all this, i know you should work on your basic game 1st.. instead of models use cubes to represent them and figure out the movement and shooting system and all that stuff 1st.

quejob
21
Years of Service
User Offline
Joined: 27th Jun 2003
Location:
Posted: 27th Jun 2003 10:08
If you are having trouble using the tutorial that Db posted then try my own menu which isnt as goos nor as complicated and it works!
just make your list such as PLay, Options, Control Configuration... ext. then make a sphere really small like this make object sphere 1,2
then center text for each option. start off like this center text 100,10,"PLay" then center text 100,40,"Options" center text 70,100,"Control Configuration" once that is out of the way make a loop for the option scrolling view the sorce code for other details
if you want to use the center text with the 3d objects then you will run into some problems so you got to make plains and so on i'm sure you know how to do that if not post anoter discussion and i'll help if not others your welcome... p.s. I didn't make the labels so you got to make them and so on

Xenosis
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location:
Posted: 27th Jun 2003 15:53
Quejob.. I've just tryed your menu, and i cant get it to work..

The sceen is just blue when i try to compile it.. Also when i have'nt add'ed my game source to the code...

i've posted the source with the modifacations i've made..

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 27th Jun 2003 18:45 Edited at: 27th Jun 2003 18:45
Quote: "do
position object 1,xpos,ypos,zpos
if upkey()=1 then ypos=ypos-30
if downkey()=1 then ypos=ypos+30
if ypos=10 and spacekey()=1 then goto play
if ypos=40 and spacekey()=1 then goto Options
if ypos=70 and spacekey()=1 then goto config
loop"


Nothing will appear on screen unless you "sync" it

Login to post a reply

Server time is: 2024-09-20 13:30:28
Your offset time is: 2024-09-20 13:30:28