Sure Brent, thanks for looking.
The test code looks as follows:
For the test function:
local shape = display.newImage("test\_shape.png", 0, 0); shape.anchorX = 0; shape.anchorY = 0; local mask = graphics.newMask("test\_mask.png"); shape:setMask( mask ); shape:addEventListener("tap", M.shapeTouched); local event = { name="tap", x=64, y=5, target=shape,time=1011,numTaps=1}; shape:dispatchEvent( event );
And then for the listener:
M.shapeTouched = function(event) print("TAP TRIGGERED"); end
The way I wanted this to behave was to not trigger the listener because the tap event is being dispatched with an x, y in the masked area. But the actual behavior is the shapeTouched handler is always called and TAP TRIGGERED always gets printed. It seems like the listener function gets called no matter where the coordinates are; even if they are way off of the image.
Another thing I tried was triggering a tap event on a graphic layer above this shape, hoping that maybe propagation would make it work right, but in that case the listener wasn’t triggered at all.
Thanks for the help.