How do I make a rectangle untouchable until event.phase == “ended”.
Description:
There are two rectangles in the group. If there was a touch on the group, the group should be untouchable until the end the touch. With setting alpha 0 it is not working.
Code is below:
function touchListener(event) if (event.phase == "began") then --do something and then do untouchable rectGroup elseif (event.phase == "ended") then --do rectGroup visiable to touch end end rectGroup = display.newGroup(); local rect1 = display.newRect(rectGroup, 0, 0, 74, 308); local rect2 = display.newRect(rectGroup, 0, 308, 97, 254); rectGroup:addEventListener("touch", touchListener);