If I have a few objects on top of one another, and add an event listener as tap or touch, all objects get the tap/touch.
How can I do it so that only the top one gets the tap/touch ?
Do I manually add a .z or is there a better way ? [import]uid: 61610 topic_id: 10336 reply_id: 310336[/import]
You can mark an event as handled by simply returning true from the event handler function.
[code]
– This function gets called when the top object is tapped
local onTap = function( event )
– Do whatever you want here, and then return true. This will stop the event propagating down
– the display hierarchy
return true
end
[code] [import]uid: 5833 topic_id: 10336 reply_id: 37713[/import]
Thank you so much [import]uid: 61610 topic_id: 10336 reply_id: 37714[/import]
No worries, if you have any trouble just ask. [import]uid: 5833 topic_id: 10336 reply_id: 37715[/import]