Putting player names depth at a high depth to have them always visible
authorDavid Négrier <d.negrier@thecodingmachine.com>
Mon, 11 May 2020 17:16:36 +0000 (19:16 +0200)
committerDavid Négrier <d.negrier@thecodingmachine.com>
Mon, 11 May 2020 17:16:36 +0000 (19:16 +0200)
front/src/Phaser/Entity/PlayableCaracter.ts

index 33b5c3aa845b8f1c0454927f48bcd60d3d883b12..c258a9fb3f05e29311cee31d1396df848b459ecd 100644 (file)
@@ -37,7 +37,7 @@ export class PlayableCaracter extends Phaser.Physics.Arcade.Sprite {
         this.PlayerValue = name;
         this.PlayerTexture = texture;
         this.playerName = new BitmapText(scene, x, y - 25, 'main_font', name, 8);
-        this.playerName.setOrigin(0.5).setCenterAlign();
+        this.playerName.setOrigin(0.5).setCenterAlign().setDepth(99999);
         scene.add.existing(this.playerName);
 
         this.scene.sys.updateList.add(this);