Skip to content

Commit

Permalink
Merge pull request #15497 from crowplexus/patch-7
Browse files Browse the repository at this point in the history
allow health icons to have infinite sizes
  • Loading branch information
ShadowMario committed Sep 15, 2024
2 parents 8d1b07e + 957a5e6 commit d9c6e04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/objects/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d9c6e04

Please sign in to comment.