SilverTree7622 / Phaser3_GUI_Inspector

this is custom dat.GUI only for phaser3 debug or etc
https://github.com/SilverTree7622/Phaser3_GUI_Inspector
MIT License
74 stars 1 forks source link

Ability to disable the inspector to play the game normally? #10

Open jrabek opened 3 years ago

jrabek commented 3 years ago

I have the inspector installed and working (super awesome btw!), but it is always enabled meaning that the original pointerup events aren't handled by the game objects any more.

Is there a hotkey or config to dynamically disable/enable the inspector so it only appears when I need it?

jrabek commented 3 years ago

Looking through the source there doesn't seem to be corresponding off calls for each _scene.input.on(...) that is installed meaning once it is installed there isn't a way to remove it.

Calling PhaserGUI.destroyGUI() from the terminal will kill the GUI but the handlers are still in place in phaser.

Seems that when adding the event handlers in https://github.com/SilverTree7622/Phaser3_GUI_Inspector/blob/master/js/manager/InputManager.js#L101, a context should be passed so that later the specific event handlers can be removed (https://photonstorm.github.io/phaser3-docs/Phaser.Input.InputPlugin.html#off__anchor) when hiding the GUI.