Hi Corona programmers,
I’m having a really strange problem which could probably be a bug, but I need some help to make that clear.
I have a group object (shapeGroup) that contains n groups (middleGroup) with an image inside. The middleGroups are then masked, mainly to prevent touch listener to register events when you click outside the actual image itself (isHitTestMasked is set to true).
The problem is that, when adding a touchListener to middleGroups, some of it will behave correctly, registering events normally, other will register event just in some portions of the image itself (even if you tap on visible portions of the image).
Here is a sample code to make you better understand what I do:
local composer = require("composer") local scene = composer.newScene() local shapeGroup local shape = "snowman" local function onTouch(event) if event.phase == "began" then print(event.phase) local circle = display.newCircle(shapeGroup,event.x-shapeGroup.x,event.y-shapeGroup.y,5) circle:setFillColor(1,0,0) elseif event.phase == "moved" then print(event.phase) elseif event.phase == "ended" then print(event.phase) end return true end function scene:create(event) shapeGroup = display.newGroup() shapeGroup.x = \_viewW\*0.5 shapeGroup.y = \_viewH\*0.5 local sheetInfo = require ("Grafica.ColorGame."..shape) local imageSheet = graphics.newImageSheet("Grafica/ColorGame/"..shape..".png", sheetInfo:getSheet()) local frameNo = #sheetInfo.sheet.frames local sheetFrames = sheetInfo.sheet.frames for i = 1, frameNo\*0.5 do local group = display.newGroup() local shapePart = display.newImageRect( group ,imageSheet, i, sheetFrames[i].width , sheetFrames[i].height ) shapePart.maskFile = "Grafica/ColorGame/"..shape.."Mask"..i..".png" shapePart.name = shape..i shapeGroup:insert(group) local mask = graphics.newMask(shapePart.maskFile) group:setMask(mask) end end function scene:show(event) local sceneGroup = self.view local phase = event.phase if (phase == "will") then print(shapeGroup.numChildren) for i = 1, shapeGroup.numChildren do shapeGroup[i]:addEventListener("touch",onTouch) end end end
(edited the code removing useless chunks, like composer events, for better reading)
Please note that my images are inside an ImageSheet (created with Texture Packer) and are as big as my content area.
Same with the masks, which are as big as the screen (1280,800) but unfortunately not inside an ImageSheet (because you can’t create a mask from an ImageSheet… yet)
In my touch listener I draw a circle if the event is started… but when I run the code only the second image gets all the touches…
What is really strange is that the touch is invoked if you touch a very specific area of one of the two malfunctioning images…
I don’t know if you need to run the code to better understand the situation, in case let me know and I’ll provide all graphics required! 
Here’s a screenshots of what I’m getting:

The red area represents where the event get’s called correctly. Please note the top and bottom portions, and also the left part of the middle segment which is not “touchable”.
I doesn’t seem to be a problem of mask misplacement as the images are showed exactly as I want and where I want… really clueless about this…