Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling animation.next inside onloop callback is not working. #1838

Open
ScreamZ opened this issue Oct 24, 2023 · 0 comments
Open

Calling animation.next inside onloop callback is not working. #1838

ScreamZ opened this issue Oct 24, 2023 · 0 comments

Comments

@ScreamZ
Copy link

ScreamZ commented Oct 24, 2023

@dtex @rwaldron
Hello guys, hope you're well.

First issue

When using the Animation API there is no way out from onloop callback using animation.next

The next function is watch for isRunning === true and prevent going to next.

next() {
if (this.isRunning) {
return this;
} else {
this.isRunning = true;
}

If we call pause right before, this is not working too because it doesn't turn running false.

pause() {
this.emit("animation:pause");
if (this.playLoop) {
this.playLoop.stop();
}
this.paused = true;
if (this.onpause) {
this.onpause();
}
}

if we call stop we clear the stack because this

this.segments = [];

So we can't go to the next animation.

Only solution is to call stop and trigger a new animation from within the callback.

Second issue

oncomplete callback is not called for current animation when using stop(). But it only call onStop

Maybe we could think about something else ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant