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.

Author
Message
Jallen
16
Years of Service
User Offline
Joined: 31st Jul 2007
Location: object position x(Jallen)
Posted: 23rd Aug 2007 17:06
Hello, im making a simple first person RPG for something to do.
Im not very used to using dark basic and i was wondering what a good way to have buttons in a menu would be.

basically, i dont need it to change appearance or move when i click it, i basically want a box behind some text that will detect if im clicking it or not.

how would i achieve this?
Thanks.
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 23rd Aug 2007 17:45 Edited at: 23rd Aug 2007 17:45
Go to the bottom of the page and your see a search bar, type "button(s)" and you'll find your answer. Good luck
DK_
20
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 23rd Aug 2007 18:34
there are a few different ways to achieve this.

1) Make an image of the button and make it a sprite at the location you want. Make another 1x1 image and make that a sprite as well. When the mouse is clicked, position the 1x1 sprite at the mouse location, and check if it is touching the button "sprite collision(1,2)" if it returns a 1 then the button has been clicked.

2) requires no media. Simply write the text to the screen. Then if the mouse has been clicked, check if the mouse is over the text:


TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK

Login to post a reply

Server time is: 2024-05-07 09:30:26
Your offset time is: 2024-05-07 09:30:26