Skip to content

Commit b87c206

Browse files
authored
Fix Icon anim/transition offsets (#747)
1 parent 0f83544 commit b87c206

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

source/funkin/game/HealthIcon.hx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ class HealthIcon extends FunkinSprite
232232
else if (node.exists("offsety"))
233233
offsetY = Std.parseFloat(node.get("offsety")).getDefault(0);
234234

235-
addOffset(animName, offsetX, offsetY);
236-
237-
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), false); // don't allow looping for transitions
235+
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), false, null, null, offsetX, offsetY); // don't allow looping for transitions
238236
if (animateAtlas == null && animation.exists(animName))
239237
animation.getByName(animName).flipX = isPlayer != iconIsPlayer;
240238
case "anim":
@@ -265,15 +263,13 @@ class HealthIcon extends FunkinSprite
265263
else if (node.exists("offsety"))
266264
offsetY = Std.parseFloat(node.get("offsety")).getDefault(0);
267265

268-
addOffset(animName, offsetX, offsetY);
269-
270266
var looped:Bool = false;
271267
if (node.exists("looped"))
272268
looped = node.get("looped").toLowerCase() == "true";
273269
else if (node.exists("loop"))
274270
looped = node.get("loop").toLowerCase() == "true";
275271

276-
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), looped);
272+
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), looped, null, null, offsetX, offsetY);
277273
if (animateAtlas == null && animation.exists(animName))
278274
animation.getByName(animName).flipX = isPlayer != iconIsPlayer;
279275
case "step":
@@ -457,4 +453,4 @@ enum abstract TrackerAlignment(Int) {
457453
* Mathematically: `tracker.x + tracker.width`
458454
*/
459455
var RIGHT = 2;
460-
}
456+
}

0 commit comments

Comments
 (0)