From 3bf884ced1b89d452daacb6b5127cf687e712c34 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 24 Aug 2018 09:11:59 -0300 Subject: Fix action labels not showing up --- index.js | 6 +++--- 1 file 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) { -- cgit 1.3.0-6-gf8a5