omega
omega

Reputation: 43863

How to chain multiple tweens in Tween.js?

I'm using tween.js to chain things.

https://github.com/tweenjs/tween.js/blob/master/docs/user_guide.md

If I want to tween A, then B, then C, I could do it like this:

var tweenA = [...];
var tweenB = [...];
var tweenC = [...];

tweenA.chain(tweenB.chain(tweenC));

But what if I have A, B, C, D, and want to make B and C run at same time after A, and then make D run after B and C finishes.

I can make B and C run together after A like this

A.chain(B, C)

But how do I then chain D?

Note I want to avoid .onComplete calls, because in reality I have an array like this

[A, [A1,A2], B, [B1, B2], C, [C1, C2], ...]

and then A runs, then A1/A2 runs at same time, then B runs, then B1/B2 runs at same time, etc....

So I am looking for a way to make it work for arrays really.

Thanks

Upvotes: 2

Views: 483

Answers (0)

Related Questions