Speech bubbles always on top
authorRuben Rodriguez <ruben@gnu.org>
Wed, 10 Mar 2021 20:42:15 +0000 (15:42 -0500)
committerRuben Rodriguez <ruben@gnu.org>
Wed, 10 Mar 2021 20:42:15 +0000 (15:42 -0500)
front/src/Phaser/Entity/SpeechBubble.ts

index f2385290e9ecf51f8da446de0fee1e7340c72d40..810de008979ca37e17542e69ea3aa162ea5b8974 100644 (file)
@@ -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));