Putting player names depth at a high depth to have them always visible

This commit is contained in:
David Négrier 2020-05-11 19:16:36 +02:00
parent 89c22e9964
commit 39f1952f94

View File

@ -37,7 +37,7 @@ export class PlayableCaracter extends Phaser.Physics.Arcade.Sprite {
this.PlayerValue = name; this.PlayerValue = name;
this.PlayerTexture = texture; this.PlayerTexture = texture;
this.playerName = new BitmapText(scene, x, y - 25, 'main_font', name, 8); 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); scene.add.existing(this.playerName);
this.scene.sys.updateList.add(this); this.scene.sys.updateList.add(this);