super(scene, x, y, 'main_font', text, 32);
this.scene.add.existing(this);
- this.underLine = this.scene.add.text(x, y+1, '_______', { fontFamily: 'Arial', fontSize: "32px", color: '#ffffff'})
+ this.underLine = this.scene.add.text(x, y+1, '______________', { fontFamily: 'Arial', fontSize: "32px", color: '#ffffff'})
let keySpace = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
private deleteLetter() {
this.text = this.text.substr(0, this.text.length - 1);
- if (this.underLine.text.length > this.underLineLength) {
- this.underLine.text = this.underLine.text.substr(0, this.underLine.text.length - 1);
- }
}
this.textField = new TextField(this, this.game.renderer.width / 2, 50, 'Enter your name:');
this.textField.setOrigin(0.5).setCenterAlign()
- this.nameInput = new TextInput(this, this.game.renderer.width / 2 - 64, 70, 4, this.name,(text: string) => {
+ this.nameInput = new TextInput(this, this.game.renderer.width / 2 - 128, 70, 8, this.name,(text: string) => {
+
this.name = text;
if (window.localStorage) {
window.localStorage.setItem('playerName', text);