From 8bab6196e50420c6586441f2d321bd1c139567c3 Mon Sep 17 00:00:00 2001 From: PurSnake Date: Sun, 17 Aug 2025 00:20:39 +0300 Subject: [PATCH] RESPECT --- source/funkin/play/components/HealthIcon.hx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/funkin/play/components/HealthIcon.hx b/source/funkin/play/components/HealthIcon.hx index 2d0b4cc78..236ea4805 100644 --- a/source/funkin/play/components/HealthIcon.hx +++ b/source/funkin/play/components/HealthIcon.hx @@ -115,6 +115,8 @@ class HealthIcon extends FunkinSprite */ static final POSITION_OFFSET:Int = 26; + public var iconOffset:FlxPoint = FlxPoint.get(); + public function new(char:Null, playerId:Int = 0) { super(0, 0); @@ -182,8 +184,7 @@ class HealthIcon extends FunkinSprite loadCharacter(characterId); this.size.set(1.0, 1.0); - this.offset.x = 0.0; - this.offset.y = 0.0; + iconOffset = FlxPoint.get(); this.flipX = false; } else @@ -194,8 +195,7 @@ class HealthIcon extends FunkinSprite loadCharacter(characterId); this.size.set(data.scale ?? 1.0, data.scale ?? 1.0); - this.offset.x = (data.offsets != null) ? data.offsets[0] : 0.0; - this.offset.y = (data.offsets != null) ? data.offsets[1] : 0.0; + iconOffset = FlxPoint.get((data.offsets != null) ? data.offsets[0] : 0.0, (data.offsets != null) ? data.offsets[1] : 0.0); this.flipX = data.flipX ?? false; // Face the OTHER way by default, since that is more common. } } @@ -291,6 +291,8 @@ class HealthIcon extends FunkinSprite // Keep the icon centered vertically on the health bar. this.y = PlayState.instance.healthBar.y - (this.height / 2); // - (PlayState.instance.healthBar.height / 2) + + offset += iconOffset; } }