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 / main menu help please

Author
Message
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 12th Nov 2002 21:41
Hi i am making a main menu for my game but i dont know how to make a drop down menu or how to use the mouse click command for menus please help here are my codes:

rem setup
sync on
sync rate 30

rem make main menu
MAIN:
center text 100,10,"START GAME"
center text 250,10,"PRACTICE"
center text 400,10,"OPTIONS"
center text 550,10,"QUIT"

REM MAKE DROP DOWN MENUS WHEN CLICKED ON

I got the codes for the mouse but i don't know which number is which on it and how to get it to make the menu have a drop down when u click on it.

here is the botton code:
if btn_click(220,75,440,125)
gosub Drop_down_1

please help me.
TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 13th Nov 2002 00:46
go learn it by yourself. just joking. but it would really help you if do(a lot of time to spend) but here it is. i code it myself(learned it by myself which i know a lot about it) and i think this would really help. just pop it in and run it. though, i did not include the scroll down thing. i might try porgraming that someday depending on if i want it. enjoy.



The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 13th Nov 2002 01:10
I'll get back to you, I'm working on it right now for you.
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 13th Nov 2002 18:05
thanks nvs_victor

thanks thedarthster i can't wait to see what u can do as well to help
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 13th Nov 2002 22:45
This might take a while, I'm trying to do a really ambitious menu system, which should look ace when I'm done.
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 14th Nov 2002 21:39
Thanks thedarthster
I can wait for it as long as it takes.
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 14th Nov 2002 22:01
I've got a menu system (without no drop-down).
It's in 3D. Get the source at my homepage.
http://TheCyborg.amok.dk

A screener:


TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 15th Nov 2002 19:05
Thanks TheCyborg but when i downloaded it it won't open.
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 16th Nov 2002 22:53
I've decided to stop with the ambitiousness and make one that's fairly easy to understand and implement.



Supports one sub menu layer. No animation included, but it's easy enough to implement - if the menu choice changes then do some animation routine. To adapt this for pop up menus, add extra parameters into both functions indicating where the menu was first brought up (usually at the mouse coordinates with a right click) etc. You can do just about any modification, sprites instead of boxes, 3d objects as menu items, more sub menu layers, I won't go into it now. This code is nowhere near perfect, so adapt it at your will.
simonuk74
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 17th Nov 2002 02:27
Darthster, I got a few probs

I looked at ur code, and its just the kinda thing I need for the menu system on the database I`ve written.
Thing is, I wont copy ur code, so I learned how it worked, then wrote my own, but I got a prob, - how did you get the text to stay ON TOP of the boxes ?



I just cant figure it out, any ideas ?

simon

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Nov 2002 02:41
in the functions you will see this line

center text ((x2-x1)/2)+x1,((y2-y1)/2)+y1-5,menu_button$(i,2)

simonuk74
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 17th Nov 2002 03:20
yep, but in my code I have a similar line, just above the `inc` commands...
but I cant see why mine wont display the text OVER the boxes.
also, for some reason I get MASSIVE slowdown if I try to run it in a function, but then again, the database is just about complete ( except a nice menu system ), and with no functions so far! lol

is there any command to FORCE text on top ?

simon

simonuk74
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 17th Nov 2002 03:41
not to worry!!

I sorted my problem out, not sure why it was giving me a head-ache..
on the..
center text screen width()/2,y1+(y2-y1),mainmenu$(a)
line, I knew that I hadn`t lined the text up with the center of the box`s height. So when I changed :
y1+(y2-y1) to y1+((y2-y1)/2)-8, to center it on the boxes, it work fine ??!!
prolly summat to do with Y co-ordinate was on the background not the boxes?

dunno, thats the only thing I can think of why it wern`t working lol

anyway, cheers ppl

simon

TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 17th Nov 2002 04:46
hey simonuk74 ,
nice job with the menu.

simonuk74
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 17th Nov 2002 12:07
cheers, nvs_victor

cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 17th Nov 2002 23:06
thanks TheDarthster
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 18th Nov 2002 00:19
No problem

Login to post a reply

Server time is: 2024-04-19 05:24:35
Your offset time is: 2024-04-19 05:24:35