PDA

View Full Version : Stop transparent parts of bitmap being clickable


Bombdogs
02-21-2008, 05:08 PM
Hi all,

Is there an easy way of ignoring the transparent pixels of a bitmap when listening for a mouse click event?

I've got a bitmap circle that's draggable, but the corners of the bitmap (which are transparent because a circle is not sqaure) also allow the user to pick up the object. I know I could create a vector mask & assign the listener to that instead, but I'm wondering if there's a simple trick I'm missing.

Thanks,

PMF

xwielder
02-21-2008, 05:29 PM
I don't think so, but I too would be interested in achieving this without masking.

lookatme0128
02-21-2008, 06:52 PM
you could make a button symbol and only have a hit area and no up, over, or down states. make the hit area the same size as your circle....lay it over your bitmap and there you have it!

savager2
02-21-2008, 07:03 PM
there's a new class that handles this.. hold on i'm looking for it..

savager2
02-21-2008, 07:05 PM
http://blog.mosessupposes.com/?p=40

Bombdogs
02-21-2008, 07:10 PM
Nice spot savager, that's perfect - thanks for the link!

PMF