Touch Events with transparent PNG

Is there a way to ignore touch events over transparent sections of a PNG?

Not at present; can you give me an indication of what kind of shape we're talking about here?

Peach :)

Two things to keep in mind:

First off, fingers touching aren't that accurate so for most images it won't matter. Sometimes people forget this because they're only testing in the simulator.

For situations where the transparent area is huge and thus noticeable, you can work around the problem by putting a few invisible rectangles over the object and listen for touches on those:
http://developer.anscamobile.com/content/objectishittestable

Not trivially easy, but because of the first point you can get away with fewer pieces than you might expect.

Any image in general, for example this one I googled - http://upload.wikimedia.org/wikipedia/en/e/e8/Banksia_man.png

The bounding box contains empty space which I wouldn't want to respond to touches to.

@jhocking Thanks for the suggestion

ignoring transparent bits on an image won't work.

create a polygon around the non transparent image and then do a point in polygon detection -- if you have more than one polygon, create a group, add each polygon to the group, then traverse the group to see if the pt hits inside of n polygon.

c.

views:1825 update:2011/10/1 9:04:19
corona forums © 2003-2011