text alpha (see through)

This commit is contained in:
Mashy 2018-11-18 10:20:35 +10:00
parent 3dc6baf2b9
commit e3277c3478

View File

@ -108,17 +108,16 @@ class PhaserPassives extends Phaser.Scene {
displayPassiveText(node, pointer) { displayPassiveText(node, pointer) {
if (this.nodeText) this.nodeText.destroy(); 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', fontSize: '20px',
fontFamily: 'Arial', fontFamily: 'Arial',
color: '#ffffff', color: '#ffffff',
backgroundColor: '#222222', backgroundColor: '#222222',
}).setPadding(32); }).setPadding(32);
this.nodeText.setScale(1 / this.cameras.main.zoom); this.nodeText.setAlpha(0.8);
this.nodeText.setWordWrapWidth(450);
this.nodeText.setPosition(node.x, node.y);
this.nodeText.setOrigin(pointer.x >= 600 ? 1 : 0, pointer.y >= 450 ? 1 : 0); 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() { updatePassives() {