question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`AnimatedSprite`: `onComplete` never fires

See original GitHub issue

I have a three-frame animation stored in frames. I’d expect that this code would fire whenever the third frame is reached:

const jack = new PIXI.extras.AnimatedSprite(frames);
jack.onComplete = () => {
	console.log("complete");
};
jack.play();

However, it doesn’t look like it’s ever fired. onFrameChange, on the other hand, seems to work as expected, so I’m sure that I’m using onComplete the right way.

Is this a bug or am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
themoonratcommented, May 31, 2017

It makes sense for onComplete not to fire if the animation is looped. A new onLoop callback would be a welcome PR imo. You can’t rely on onFrameChange for a specific frame index in case the frame rate is low and you never actually hit that specific frame index

1reaction
themoonratcommented, Jun 1, 2017

I can do that tomorrow

Read more comments on GitHub >

github_iconTop Results From Across the Web

AnimatedSprite : onComplete never fires #4072 - GitHub
I have a three-frame animation stored in frames. I'd expect that this code would fire whenever the third frame is reached: const jack...
Read more >
onComplete never fires or the animation just breaks - GSAP
Hi so I am trying to get an on complete call back when the animation is finished but it just won't work when...
Read more >
PIXI.js AnimatedSprite lag on first play - Stack Overflow
1) The lag might be caused by the time taken to upload the textures to the GPU. There is a PIXI plugin called...
Read more >
How to make spine's onComplete event fires while losing tab ...
As I tested, if I run several spine animations(different length) at the same time, then switch to another tab immediately, the onComplete events ......
Read more >
AnimatedSprite animation not waiting to complete before ...
I dont know why.... I have things broken down into idle, turn and move states, and I want to have the 2 frame...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found