Closed rfaile313 closed 3 years ago
can you explain more what is the problem exactly
i will try to fix that
oh! sorry i forgot i have some work to do sorry i wanted to work on your game but i have somethings to do
If you build the program and run it you'll see that you can't put spaces in any of the text input boxes, that is the bug.
This is fixed. I found out you can't access these properties directly and need to use the built in functions from phaser due to getters/setters and actually removing/adding event listeners.
Specifically, calling disableGlobalCapture()
and enableGlobalCapture()
Solution:
const chatBox = document.getElementById("chat");
chatBox.addEventListener("focus", () => {this.input.keyboard.disableGlobalCapture()});
chatBox.addEventListener("blur", () => {this.input.keyboard.enableGlobalCapture()});
See: https://photonstorm.github.io/phaser3-docs/Phaser.Input.Keyboard.KeyboardPlugin.html
These two boxes, for example:
I don't really mind that player names don't have spaces, but would like folks to be able to make spaces in chat.