diff options
author | Florrie <towerofnix@gmail.com> | 2018-08-24 09:11:59 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-08-24 09:11:59 -0300 |
commit | 3bf884ced1b89d452daacb6b5127cf687e712c34 (patch) | |
tree | 9e1fe2bef60b7affd5e0ada237f42d5326f159ee | |
parent | 5d99f66c4025a1e2bce1e20c60c7118d40b5f475 (diff) |
Fix action labels not showing up
-rw-r--r-- | index.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/index.js b/index.js index 96db27e..b91faf2 100644 --- a/index.js +++ b/index.js @@ -1030,7 +1030,7 @@ class Battle { } } - for (const { sprite, drawX, canvasOffsetDrawY } of spriteData) { + for (const { sprite, centerX: spriteCenterX, y: spriteTopY } of spriteData) { if (!(sprite instanceof BattleCharacter)) { continue } @@ -1040,8 +1040,8 @@ class Battle { ctx.font = '5px pixel-font' const width = ctx.measureText(label).width + 4 - const x = Math.round(drawX - width / 2) - const y = Math.round(canvasOffsetDrawY) + const x = Math.round(spriteCenterX - width / 2) + const y = Math.round(spriteTopY) let textFillStyle if (sprite.team === this.playerCharacter.team) { |