This commit is contained in:
Hanusiak Piotr
2022-02-07 15:10:20 +01:00
parent e34a72c865
commit 330b6ea1c5
4 changed files with 12 additions and 14 deletions
+5 -6
View File
@@ -1,15 +1,14 @@
import { Easing } from '../../types';
import { Easing } from "../../types";
export class TalkIcon extends Phaser.GameObjects.Image {
private shown: boolean;
private showAnimationTween?: Phaser.Tweens.Tween;
private defaultPosition: { x: number, y: number };
private defaultPosition: { x: number; y: number };
private defaultScale: number;
constructor(scene: Phaser.Scene, x: number, y: number) {
super(scene, x, y, 'iconTalk');
super(scene, x, y, "iconTalk");
this.defaultPosition = { x, y };
this.defaultScale = 0.15;
@@ -39,7 +38,7 @@ export class TalkIcon extends Phaser.GameObjects.Image {
this.alpha = 0;
}
this.showAnimationTween = this.scene.tweens.add({
targets: [ this ],
targets: [this],
duration: 350,
alpha: show ? 1 : 0,
y: this.defaultPosition.y,
@@ -47,7 +46,7 @@ export class TalkIcon extends Phaser.GameObjects.Image {
ease: Easing.BackEaseOut,
onComplete: () => {
this.showAnimationTween = undefined;
}
},
});
}