I’ve currently been thinking about how I could register only touch events on the visible (non-transparent) parts of a .PNG image.
-I’ve been testing around with AndEngine and it seems they have multiple options: I’ve tried any I could find to no avail.
-I could very possibly create my own method of checking a given touched area’s transparency I suppose, but not sure how much work/overhead that might create with 15-20 objects on screen being able to be touched..
Any help is much appreciated!
One simple way to do it would be to grab the the pixel color at the touch location. Then you can check if the pixel is transparent:
Note: Depending on how you implement your touch listener will might need to convert the x,y location of the touch event to the x,y coordinates of the image view.