diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts index a7e9c99b..1bd6540a 100644 --- a/front/src/Phaser/Entity/Character.ts +++ b/front/src/Phaser/Entity/Character.ts @@ -37,7 +37,7 @@ export abstract class Character extends Container { //private teleportation: Sprite; private invisible: boolean; public companion?: Companion; - private emote: Phaser.GameObjects.DOMElement | null = null; + private emote: Phaser.GameObjects.Text | null = null; private emoteTween: Phaser.Tweens.Tween | null = null; scene: GameScene; private readonly _pictureStore: Writable; @@ -336,10 +336,7 @@ export abstract class Character extends Container { playEmote(emote: string) { this.cancelPreviousEmote(); const emoteY = -45; - const image = new Image(16, 16); - image.src = emote; - this.emote = new DOMElement(this.scene, -1, 0, image, "z-index:10;"); - this.emote.setAlpha(0); + this.emote = new Text(this.scene, -10, 0, emote, { fontFamily: "Twemoji Mozilla", fontSize: "20px" }); this.add(this.emote); this.createStartTransition(emoteY); } diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 1b110de5..34a6dbb7 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -653,8 +653,8 @@ export class GameScene extends DirtyScene { this.emoteUnsubscribe = emoteStore.subscribe((emote) => { if (emote) { - this.CurrentPlayer?.playEmote(emote.url); - this.connection?.emitEmoteEvent(emote.url); + this.CurrentPlayer?.playEmote(emote.unicode); + this.connection?.emitEmoteEvent(emote.unicode); emoteStore.set(null); } });