Ah, okay, here’s a trick I sometimes use when I don’t want any touch event to occur.
-
Create a widget button with transparent png file that covers the entire screen, let’s call it btnBlockTouch.
-
Attach a function that does nothing but return true.
-
Create all scene elements.
-
Call btnBlockTouch:toFront()
-
Create and show overlay that would come on top of the scene elements
-
When you close the overlay, call btnBlockTouch:toBack()
You can also simply create btnBlockTouch immediately after all screen elements are created and not bother with bringing it to front, and remove it when you don’t want it anymore, rather than sending it back.
Another method might be to add .isActive property to buttons on screen, and set it to false until you’re ready for the button to do something. And the function would only work if .isActive property is true – but if you just want all screen elements to be turned off, this approach may require just a lot more code you don’t need to deal with.
I’ve never used overlay, so I’m simply assuming that somehow, users can end up touching things behind the overlay… or somehow, you have trouble getting it to appear before users start touching the scene…
I hope this helps anyhow.
Naomi