PNG transparency overlap causes touch event on both object to fire

I have two images that I am going to place in the lower corner of the device screen. The red image is for firing and the blue is for activating shields.

Both Images have transparency and because they are located next to each other the transparencies overlap. The problem is adding touch events to both and then just touching say the red area fires both touch events but if they are far away from each other clicking in a transparent area the touch event doesn’t fire on the single image as expected.

I need to find a solution because I would like to leave the controls laid out as I have them.

Download sample code and images I am using from here http://mattwallace.s3.amazonaws.com/touch_example.zip
[import]uid: 7501 topic_id: 19633 reply_id: 319633[/import]

just put “return true” at the end of your touch functions and they will not fire together then

and why wont you just get rid of transparency fields? [import]uid: 16142 topic_id: 19633 reply_id: 75853[/import]

what do you mean “get rid of transparency fields” ?

I will give the return true change a try. Thanks! [import]uid: 7501 topic_id: 19633 reply_id: 75859[/import]

returning true in each handler didn’t seem to help. [import]uid: 7501 topic_id: 19633 reply_id: 75860[/import]

in your gpx program remove the transparency
in PS go to image and trim
dont know gimp way but its there [import]uid: 7911 topic_id: 19633 reply_id: 75862[/import]

You have to
[lua] return true[/lua]
at the end of the function for example:

[lua]local function sup(e)
display.newImage(whatever.png)
return true
end[/lua]

Hope this helps.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 19633 reply_id: 75914[/import]