partey_workadventure/front/src/Phaser/Components/ClickButton.ts
2021-09-06 14:31:59 +02:00

9 lines
321 B
TypeScript

export class ClickButton extends Phaser.GameObjects.Image {
constructor(scene: Phaser.Scene, x: number, y: number, textureName: string, callback: Function) {
super(scene, x, y, textureName);
this.scene.add.existing(this);
this.setInteractive();
this.on("pointerup", callback);
}
}