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 / 2 menu questions

Author
Message
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 20th Oct 2003 04:01
1.how do you make it so when a sprite is clicked it will do something?(i wanted to make my own buttons)i can only make it so when my cursor touches it, not clicks, it does something.What do i do?

2.I wanted to make it so if you push escape while you are in my game the menu wold come back up.I tried just hiding the objects but an error occured.How can i do this?
Thanks!
thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 20th Oct 2003 04:42
Make your own buttons? There are two ways. The first is to check to see if the mouse is within a defined area by using greater and less than signs. The reason I don't say how to do that is because its: a)very hard, and b)never works. Instead, make your own cursor, like this:



Then, simply check for a mouseclick while the cursor sprite is overlapping the button sprite, like this:



Hope that's what you wanted.

Gentlemen, your physics books were wrong. All of everything consists of two elements: me and the computer.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Oct 2003 22:31
i am currently making a function that makes it really easy to make buttons. basically you type type
button(xpos,ypos,xsize,ysize,color,target)
and it makes the button for you and everything. but im working out some problems i am having. i hope to get it finished today, depending on how much time i have on the computer and how often i am home. but i will post the finished code soon (hopefully)

<{^_^<}

Login to post a reply

Server time is: 2025-05-21 09:30:09
Your offset time is: 2025-05-21 09:30:09