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 / Picture Clicking

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 3rd May 2007 20:46
How do click on certain parts of one image and have certain functions?

Thanks,

Jordan Stories Games

Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 4th May 2007 17:22
You need to check if the mouse is inside the area you want to click.
Example:
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 9th May 2007 04:18
or have several sprites,if the user clicks that certain part have whatever happen.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 9th May 2007 04:24
I've done it both ways mentioned above. And unless your going to have a lot of click zones throughout I'd use David iz cool's suggestion. You can even make the sprites transparent, and it's takes a lot of the work out checking tons of rects.

The other way, is to have a BMP that has zones (sorta like a mouse map), that isn't displayed on the screen that you can check the pixel color for mouse clicks.

If you are going to check the mouse area, it's better for you to code some handling routines, and have a UDT keep track of image zones.

See which method you like best!

Login to post a reply

Server time is: 2024-11-25 17:56:38
Your offset time is: 2024-11-25 17:56:38