partey_workadventure/front/src/Phaser/Components/TextField.ts

10 lines
352 B
TypeScript
Raw Normal View History

export class TextField extends Phaser.GameObjects.BitmapText {
constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], center: boolean = true) {
2021-09-06 14:27:54 +02:00
super(scene, x, y, "main_font", text, 8);
this.scene.add.existing(this);
if (center) {
2021-09-06 14:27:54 +02:00
this.setOrigin(0.5).setCenterAlign();
}
}
}