Closed ben-lau closed 3 years ago
TweenLite is deprecated. Check out the migration guide.
It's hard to debug based on a snippet of code. Are you're overwriting the animations, like maybe calling jumpTo too quickly, or animating the scale in another method?
That said, I would probably try this. There's no need to use Promise.all
.
jumpTo({ x, y }) {
const initialScale = this.scale;
return gsap.timeline()
.to(this, {
x, y,
duration: 0.3,
ease: "none"
})
.to(this.scale, {
duration: 0.1,
yoyo: true,
repeat: 1,
ease: "none",
x: initialScale.x * 1.2,
y: initialScale.y * 1.2,
}, 0.1);
}
I haven't overwriting any animations, and my project is a ludo game, jumpTo is the method of my chess view, i called jumpTo when the previous jumpTo is done:
I found this problem when I resized my window quickly, so I know it's hard to locate the problem, but I also issued this to see if I can remind you of anything.
By the way, I solved this problem with using your suggestion, thanks. Is there any different from timeline and tween?
Is there any different from timeline and tween?
A timeline is a container for tweens, so it's helpful if you want to group and sequence animations.
ok, here is another question, I found animation will paused when my window is in the background, therefore my move task will pause because of promise pending status. I use Promise.race to this animation and a promise of setTimeout to solve it, Is there anyother solution?
Do you mean like when you change tabs? Have you seen this helper function. https://greensock.com/docs/v3/HelperFunctions#hidden
oh, all right then, that helps, thank you so much
Hello, I have a ludo game project with pixi.js, and I use
TweenLite
to control my animation, and I usePromise.all
to return an animate completion status, just like this: But in some cases, I found my promise is not fulfilled, so I try to log inonStart
andonComplete
, and neither thecomplete
won't fire, nor thestart
. I cant locate the inevitable situation, case it's look like it appears randomly.FYI, the version of my gsap is
3.7.0