Popup and event handling flow

I have a popup (LayerColor + EventListenerTouchOneByOne) that I want to show on top of my main menu screen, that is:

  1. when the popup is shown - all input will go to popup touch listener
  2. when popup is hidden - all input will go to main menu’s controls’ touch listeners as usual.
  1. Add the event listener with scene graph priority. This means it gets touch before anything behind it. Then return true from onTouchBegan and nothing else should be touchable.
  2. In onTouchBegan, return false if the popup is not visible.
1 Like