Skip to content

Commit 0eeef88

Browse files
authored
Re-implement onDraw functionality for FunkinSprite (#897)
As FlxAnimate didn't have the functionality before, so we have to do the check in FunkinSprite ourselves, as it itself stop's calling the `super.draw();` when it is a `isAnimate`
1 parent 47a3526 commit 0eeef88

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

source/funkin/backend/FunkinSprite.hx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
173173
{
174174
}
175175

176+
public override function draw() {
177+
// re-implementing the `onDraw` functionality from `FlxSprite` since `FlxAnimate` didn't have this, so we have to add it back in ourselves
178+
if (this.isAnimate && this.__drawOverrided) {
179+
this.__drawOverrided = false;
180+
this.onDraw(this);
181+
this.__drawOverrided = true;
182+
return;
183+
}
184+
super.draw();
185+
}
186+
176187
// ANIMATE ATLAS DRAWING
177188
#if REGION
178189

0 commit comments

Comments
 (0)