Hover text in constants

This commit is contained in:
Mashy
2019-01-22 14:47:37 +10:00
parent f3d7037abb
commit d022b27503
5 changed files with 6 additions and 22 deletions
+2 -9
View File
@@ -86,9 +86,7 @@ class StatSheet extends Phaser.Scene {
const SKILL_X = menuX;
const SKILL_Y = (i * TEXT_MARGIN) + Y_SKILLS + TEXT_MARGIN;
const color = this.forget ? '#ff0000' : '#ffffff';
const style = { fontFamily: 'monospace', fontSize: 16, color };
this.knownSkills.add(this.add.text(menuX, SKILL_Y, skill.skill, style)
this.knownSkills.add(this.add.text(SKILL_X, SKILL_Y, skill.skill, TEXT.NORMAL)
.setInteractive()
.on('pointerdown', () => {
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
@@ -125,12 +123,7 @@ class StatSheet extends Phaser.Scene {
displaySkillText(x, y, description, pointer) {
if (this.skillText) this.skillText.destroy();
this.skillText = this.add.text(x, y, description, {
fontSize: '16px',
fontFamily: 'Arial',
color: '#ffffff',
backgroundColor: '#222222',
}).setPadding(32);
this.skillText = this.add.text(x, y, description, TEXT.HOVER).setPadding(32);
this.skillText.setAlpha(0.8);
this.skillText.setOrigin(pointer.x >= WIDTH * 0.65 ? 1 : 0,
pointer.y >= HEIGHT * 0.25 ? 1 : 0);