diff --git a/client/src/components/passive.phaser.js b/client/src/components/passive.phaser.js index 32fff296..699bb1bf 100755 --- a/client/src/components/passive.phaser.js +++ b/client/src/components/passive.phaser.js @@ -108,17 +108,16 @@ class PhaserPassives extends Phaser.Scene { displayPassiveText(node, pointer) { if (this.nodeText) this.nodeText.destroy(); - this.nodeText = this.add.text(0, 0, '', { + this.nodeText = this.add.text(node.x, node.y, node.text, { fontSize: '20px', fontFamily: 'Arial', color: '#ffffff', backgroundColor: '#222222', }).setPadding(32); - this.nodeText.setScale(1 / this.cameras.main.zoom); - this.nodeText.setWordWrapWidth(450); - this.nodeText.setPosition(node.x, node.y); + this.nodeText.setAlpha(0.8); this.nodeText.setOrigin(pointer.x >= 600 ? 1 : 0, pointer.y >= 450 ? 1 : 0); - this.nodeText.text = node.text; + this.nodeText.setWordWrapWidth(450); + this.nodeText.setScale(1 / this.cameras.main.zoom); } updatePassives() {