refactor: text
This commit is contained in:
parent
c0d6a53825
commit
e20728a9d6
|
@ -262,20 +262,21 @@ export default (latus) => class Vulnerable extends Trait {
|
|||
|
||||
acceptedHarm: (harm) => {
|
||||
const {amount, isDamage} = harm;
|
||||
const fontSize = this.constructor.harmTextSize(amount);
|
||||
this.entity.emitParticle('harm', {
|
||||
traits: {
|
||||
Colored: {
|
||||
Colorized: {
|
||||
state: {
|
||||
red: isDamage ? 255 : 0,
|
||||
green: isDamage ? 0 : 255,
|
||||
blue: isDamage ? 0 : 128,
|
||||
},
|
||||
},
|
||||
DomText: {
|
||||
DomNode: {
|
||||
params: {
|
||||
textStyle: {
|
||||
style: {
|
||||
fontFamily: 'joystix',
|
||||
fontSize: `${this.constructor.harmTextSize(amount)}px`,
|
||||
position: 'absolute',
|
||||
textShadow: [
|
||||
'-2px 2px 0 #000',
|
||||
'2px 2px 0 #000',
|
||||
|
@ -285,6 +286,11 @@ export default (latus) => class Vulnerable extends Trait {
|
|||
},
|
||||
},
|
||||
},
|
||||
DomText: {
|
||||
params: {
|
||||
fontSize,
|
||||
},
|
||||
},
|
||||
Textual: {
|
||||
state: {
|
||||
text: amount,
|
||||
|
|
Loading…
Reference in New Issue
Block a user