diff options
-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) { |