improved textField component and allowed 8 caracter names
This commit is contained in:
parent
49a0125f88
commit
67a9bd2520
10 changed files with 36 additions and 35 deletions
|
@ -1,7 +1,10 @@
|
|||
|
||||
export class TextField extends Phaser.GameObjects.BitmapText {
|
||||
constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[]) {
|
||||
constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], center: boolean = true) {
|
||||
super(scene, x, y, 'main_font', text, 8);
|
||||
this.scene.add.existing(this)
|
||||
this.scene.add.existing(this);
|
||||
if (center) {
|
||||
this.setOrigin(0.5).setCenterAlign()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue