2020-04-26 17:54:56 +02:00
|
|
|
|
2020-05-01 23:19:51 +02:00
|
|
|
export class TextField extends Phaser.GameObjects.BitmapText {
|
2020-10-15 12:05:40 +02:00
|
|
|
constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], center: boolean = true) {
|
2020-05-01 23:19:51 +02:00
|
|
|
super(scene, x, y, 'main_font', text, 8);
|
2020-10-15 12:05:40 +02:00
|
|
|
this.scene.add.existing(this);
|
|
|
|
if (center) {
|
|
|
|
this.setOrigin(0.5).setCenterAlign()
|
|
|
|
}
|
2020-04-26 17:54:56 +02:00
|
|
|
}
|
2020-05-01 22:23:41 +02:00
|
|
|
}
|