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 / detecting if clicked sprite

Author
Message
deaths judge
17
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 28th Jul 2009 16:24
how would i go about checking if the mouse is over a sprite and has been slicked ?

[[[[wobble]]]] {{{{wobble}}}}
Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 28th Jul 2009 17:00


Alternatively, you can have a sprite placed at mousex(),mousey(), something like a pixel, and check for collision between the mouse sprite and the target sprite.



Checking sprite collision against 0 will return the number of any sprite.

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 28th Jul 2009 17:02
well, the commands for finding the sprite co'ords are sprite x() and sprite y(), you can find the width and height with sprite width() and sprite height(), and for the mouse position its mousex() and mousey(), and lastly for the mouse button, its mouseclick().

The DBP help files have detailed usage instructions and examples for these commands.

Hope this helps a little

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
deaths judge
17
Years of Service
User Offline
Joined: 4th Jan 2007
Location:
Posted: 29th Jul 2009 14:54
thanks alot for the help

[[[[wobble]]]] {{{{wobble}}}}

Login to post a reply

Server time is: 2024-11-27 22:18:45
Your offset time is: 2024-11-27 22:18:45