I’ve got a question about layering images/buttons with Corona/Lua. If I create one button on top of another one and then click it, both buttons’ events are triggered. How do I prevent this? … I want
Thank You.
Code: here is the functions that goes to the scenes.
local function onSceneTouch(event)
print(event.name…" occurred")
storyboard.gotoScene(“help”, “fade”, 400)
return true
end
local function onSceneTouchS(event)
print(event.name…" occurred")
storyboard.gotoScene(“specials”, “fade”, 400)
return true
end
HERE IS THE BUTTONS
b_help = display.newImage(“buttons/help.png”)
b_help.x = 190
b_help.y = 250
screenGroup:insert( b_help )
b_help:addEventListener(“touch”, onSceneTouch)
b_thanks = display.newImage(“buttons/thanks.png”)
b_thanks.x = 190
b_thanks.y = 310
screenGroup:insert( b_thanks )
b_thanks:addEventListener(“touch”, onSceneTouchS)