From cda989f1d8961109ff85c9400dc31be94932d296 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Wed, 10 Mar 2021 15:42:15 -0500 Subject: [PATCH] Speech bubbles always on top --- front/src/Phaser/Entity/SpeechBubble.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/front/src/Phaser/Entity/SpeechBubble.ts b/front/src/Phaser/Entity/SpeechBubble.ts index f238529..810de00 100644 --- a/front/src/Phaser/Entity/SpeechBubble.ts +++ b/front/src/Phaser/Entity/SpeechBubble.ts @@ -19,6 +19,7 @@ export class SpeechBubble { let arrowHeight = bubbleHeight / 4; this.bubble = scene.add.graphics({ x: player.x + 16, y: player.y - 80 }); + this.bubble.depth=99000; // Bubble shadow this.bubble.fillStyle(0x222222, 0.5); @@ -53,6 +54,7 @@ export class SpeechBubble { this.bubble.lineBetween(point1X, point1Y, point3X, point3Y); this.content = scene.add.text(0, 0, text, { fontFamily: 'Arial', fontSize: 20, color: '#000000', align: 'center', wordWrap: { width: bubbleWidth - (bubblePadding * 2) } }); + this.content.depth=99001; let bounds = this.content.getBounds(); this.content.setPosition(this.bubble.x + (bubbleWidth / 2) - (bounds.width / 2), this.bubble.y + (bubbleHeight / 2) - (bounds.height / 2)); -- 2.25.1