🪛In Progress: Last event triggers after re-registering listeners
I’m using the low-level WebGL runtime. I’ve got a menu overlay for my game. When I open it, I register the pointer event listeners. When it’s closed, I remove the listeners. This is using a slightly modified version of the function in the example code.
Buttons that start the game such as Load and New Game hide the menu and start the game. However, when I later open the menu and register the listeners, it immediately triggers the last event causing issues like re-loading the game or starting a new game.
I am advancing the state machine and artboard by the elapsed time once after I remove the listeners.
A temporary workaround was to advance the artboard and state machine by 10 after unregistering the listeners. I attached my function to register listeners.
registerRiveListeners.js