Blocking click events

eldiablo

  • Posts: 23
Is there a simple way to limit click events to a actor type or an actor. I have a help screen that is displayed and game paused, however after the user clicks the close button the event propagates and the game control is triggered (which, of course i don't want).

I have 8 scenes and wouldn't want if at all possible to implement logic for all click receivers since this will get very bloated. I would like to handle all from the help panel actor type behavior.

froz

  • Posts: 250
I'm not sure if I understand you, but if I do, this should work. Put every click event you don't want to be run in this case in "if game is not paused" or "if help screen is opened" code block. "help screen is opened" in this case should be a boolean that is true when the help screen is opened and is changed to false after help screen was closed.

eldiablo

  • Posts: 23
I was not considering that solution for now as it would need to be put in tens if not hundreds of handlers for many mouse events across the scenes. I was hoping for a solution i could keep in one place.

But I guess if there is no other (easy) way....

eldiablo

  • Posts: 23
Ok here are my findings for future reference:

- Pausing a game stops input events from working
- You can enable specific actors to ignore pause by setting can be paused to false in actor type
- You don't need to make pause specific logic for all your input events but the event that unpauses the game if input event, bubbles after unpausing causing triggering on events below

Please correct if I'm wrong on any points