From 957a5e6432a8e544e9eb0e2cd63f11a25a76cf46 Mon Sep 17 00:00:00 2001 From: crowplexus <45212377+crowplexus@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:34:30 -0400 Subject: [PATCH] Update HealthIcon.hx --- source/objects/HealthIcon.hx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/objects/HealthIcon.hx b/source/objects/HealthIcon.hx index 18afe6788dc..fc19d415532 100644 --- a/source/objects/HealthIcon.hx +++ b/source/objects/HealthIcon.hx @@ -30,12 +30,13 @@ class HealthIcon extends FlxSprite if(!Paths.fileExists('images/' + name + '.png', IMAGE)) name = 'icons/icon-face'; //Prevents crash from missing icon var graphic = Paths.image(name, allowGPU); - loadGraphic(graphic, true, Math.floor(graphic.width / 2), Math.floor(graphic.height)); - iconOffsets[0] = (width - 150) / 2; - iconOffsets[1] = (height - 150) / 2; + var iSize:Float = Math.floor(graphic.width / graphic.height); + loadGraphic(graphic, true, Math.floor(graphic.width / iSize), Math.floor(graphic.height)); + iconOffsets[0] = (width - 150) / iSize; + iconOffsets[1] = (height - 150) / iSize; updateHitbox(); - animation.add(char, [0, 1], 0, false, isPlayer); + animation.add(char, [for(i in 0...frames.frames.length) i], 0, false, isPlayer); animation.play(char); this.char = char;