Hover text in constants
This commit is contained in:
parent
f3d7037abb
commit
d022b27503
@ -56,6 +56,7 @@ module.exports = {
|
|||||||
NORMAL: { fontFamily: 'Jura', fontSize: 18, color: '#ffffff' },
|
NORMAL: { fontFamily: 'Jura', fontSize: 18, color: '#ffffff' },
|
||||||
LEARNABLE: { fontFamily: 'Jura', fontSize: 18, color: '#ffffff' },
|
LEARNABLE: { fontFamily: 'Jura', fontSize: 18, color: '#ffffff' },
|
||||||
HEADER: { fontFamily: 'Jura', fontSize: 24, color: '#ffffff', fontStyle: 'bold' },
|
HEADER: { fontFamily: 'Jura', fontSize: 24, color: '#ffffff', fontStyle: 'bold' },
|
||||||
|
HOVER: { fontFamily: 'Jura', fontSize: 16, color: '#ffffff', backgroundColor: '#222222' },
|
||||||
},
|
},
|
||||||
|
|
||||||
POSITIONS: {
|
POSITIONS: {
|
||||||
|
|||||||
0
client/src/scenes/cryps.js
Executable file → Normal file
0
client/src/scenes/cryps.js
Executable file → Normal file
@ -81,12 +81,7 @@ class StatSheet extends Phaser.Scene {
|
|||||||
|
|
||||||
displayText(x, y, description, pointer) {
|
displayText(x, y, description, pointer) {
|
||||||
if (this.hoverText) this.hoverText.destroy();
|
if (this.hoverText) this.hoverText.destroy();
|
||||||
this.hoverText = this.add.text(x, y, description, {
|
this.hoverText = this.add.text(x, y, description, TEXT.HOVER).setPadding(32);
|
||||||
fontSize: '16px',
|
|
||||||
fontFamily: 'Jura',
|
|
||||||
color: '#ffffff',
|
|
||||||
backgroundColor: '#222222',
|
|
||||||
}).setPadding(32);
|
|
||||||
this.hoverText.setAlpha(0.8);
|
this.hoverText.setAlpha(0.8);
|
||||||
this.hoverText.setOrigin(pointer.x >= WIDTH * 0.65 ? 0 : 1,
|
this.hoverText.setOrigin(pointer.x >= WIDTH * 0.65 ? 0 : 1,
|
||||||
pointer.y >= HEIGHT * 0.25 ? 1 : 0);
|
pointer.y >= HEIGHT * 0.25 ? 1 : 0);
|
||||||
|
|||||||
@ -86,9 +86,7 @@ class StatSheet extends Phaser.Scene {
|
|||||||
const SKILL_X = menuX;
|
const SKILL_X = menuX;
|
||||||
const SKILL_Y = (i * TEXT_MARGIN) + Y_SKILLS + TEXT_MARGIN;
|
const SKILL_Y = (i * TEXT_MARGIN) + Y_SKILLS + TEXT_MARGIN;
|
||||||
|
|
||||||
const color = this.forget ? '#ff0000' : '#ffffff';
|
this.knownSkills.add(this.add.text(SKILL_X, SKILL_Y, skill.skill, TEXT.NORMAL)
|
||||||
const style = { fontFamily: 'monospace', fontSize: 16, color };
|
|
||||||
this.knownSkills.add(this.add.text(menuX, SKILL_Y, skill.skill, style)
|
|
||||||
.setInteractive()
|
.setInteractive()
|
||||||
.on('pointerdown', () => {
|
.on('pointerdown', () => {
|
||||||
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
|
this.registry.get('ws').sendCrypForget(cryp.id, skill.skill);
|
||||||
@ -125,12 +123,7 @@ class StatSheet extends Phaser.Scene {
|
|||||||
|
|
||||||
displaySkillText(x, y, description, pointer) {
|
displaySkillText(x, y, description, pointer) {
|
||||||
if (this.skillText) this.skillText.destroy();
|
if (this.skillText) this.skillText.destroy();
|
||||||
this.skillText = this.add.text(x, y, description, {
|
this.skillText = this.add.text(x, y, description, TEXT.HOVER).setPadding(32);
|
||||||
fontSize: '16px',
|
|
||||||
fontFamily: 'Arial',
|
|
||||||
color: '#ffffff',
|
|
||||||
backgroundColor: '#222222',
|
|
||||||
}).setPadding(32);
|
|
||||||
this.skillText.setAlpha(0.8);
|
this.skillText.setAlpha(0.8);
|
||||||
this.skillText.setOrigin(pointer.x >= WIDTH * 0.65 ? 1 : 0,
|
this.skillText.setOrigin(pointer.x >= WIDTH * 0.65 ? 1 : 0,
|
||||||
pointer.y >= HEIGHT * 0.25 ? 1 : 0);
|
pointer.y >= HEIGHT * 0.25 ? 1 : 0);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
const Phaser = require('phaser');
|
const Phaser = require('phaser');
|
||||||
const Node = require('./zone.node');
|
const Node = require('./zone.node');
|
||||||
const ZoneControls = require('./zone.controls');
|
const ZoneControls = require('./zone.controls');
|
||||||
const { POSITIONS: { MENU_MAIN } } = require('./constants');
|
const { POSITIONS: { MENU_MAIN }, TEXT } = require('./constants');
|
||||||
|
|
||||||
const X = MENU_MAIN.x();
|
const X = MENU_MAIN.x();
|
||||||
const Y = MENU_MAIN.y();
|
const Y = MENU_MAIN.y();
|
||||||
@ -104,12 +104,7 @@ class Zones extends Phaser.Scene {
|
|||||||
|
|
||||||
displayNodeText(node, pointer) {
|
displayNodeText(node, pointer) {
|
||||||
if (this.nodeText) this.nodeText.destroy();
|
if (this.nodeText) this.nodeText.destroy();
|
||||||
this.nodeText = this.add.text(node.x, node.y, node.text, {
|
this.nodeText = this.add.text(node.x, node.y, node.text, TEXT.HOVER).setPadding(32);
|
||||||
fontSize: '24px',
|
|
||||||
fontFamily: 'Arial',
|
|
||||||
color: '#ffffff',
|
|
||||||
backgroundColor: '#222222',
|
|
||||||
}).setPadding(32);
|
|
||||||
this.nodeText.setAlpha(0.8);
|
this.nodeText.setAlpha(0.8);
|
||||||
this.nodeText.setOrigin(pointer.x >= WIDTH * 0.65 ? 1 : 0,
|
this.nodeText.setOrigin(pointer.x >= WIDTH * 0.65 ? 1 : 0,
|
||||||
pointer.y >= HEIGHT * 0.25 ? 1 : 0);
|
pointer.y >= HEIGHT * 0.25 ? 1 : 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user