Touch Listener Question

After attaching a touch listener to a cloud graphic, I found that the listener will register touch events even if the coordinates fall outside of the cloud image but within the rectangular file dimensions.

Is this expected behavior? Is there a way to save files so that transparent pixels are not counted for touch events or is there a way to filter touch events by detecting pixel color, so only touches within the image itself count?

Thanks.

This is expected behavior. The method to resolve this is to implement a mask over your graphic. Below please find the documentation on mask utilization in Corona:

http://docs.coronalabs.com/api/library/graphics/newMask.html

This is expected behavior. The method to resolve this is to implement a mask over your graphic. Below please find the documentation on mask utilization in Corona:

http://docs.coronalabs.com/api/library/graphics/newMask.html