What tween library do you use?

Most of time I use Actuate, it stable, fast, with simple API.
But it is pain to make complex animation sequence:

public static function shake(view:View):Void {
    Actuate.tween(view, 0.05, { offsetX: -5 }).ease(Linear.easeNone);
    Actuate.tween(view, 0.05, { offsetX: 5 }, false).ease(Linear.easeNone).delay(0.05);
    Actuate.tween(view, 0.05, { offsetX: -5 }, false).ease(Linear.easeNone).delay(0.1);
    Actuate.tween(view, 0.05, { offsetX: 5 }, false).ease(Linear.easeNone).delay(0.15);
    Actuate.tween(view, 0.05, { offsetX: 0 }, false).ease(Linear.easeNone).delay(0.2);
}

Also there is bug with stopping custom functions, I send PR, but @singmajesty didn’t accept it for some reason.


I also use Delta for one of my project. It is easy to make serial sequences with Delta.
But certain things prevent me use this library:

  • Serial sequences are easy, but parallel sequences is not so easy, and hard to mix serial and parallel together (code start looks like code for actuate).
  • Expo easing is broken. I send PR, but their didn’t accept it for some reason. So next thing is:
  • I don’t understand current state of that lib. Is it forgotten (because PR aren’t reviewed) or alive (because there is some new commits to develop branch) or it will be merged into luxeengine (as sven mentioned somewhere) or … I really don’t know.

The last thing I tried was TweenX. Most promising API, easy to do almost all I need.
But code is too much optimized for flash and standard DisplayObject, so it just doesn’t work for my UI lib. I try to fix it, but it will be more easy to rewrite it from scratch rather than trying to fix it.

I thinking about creating new tween library, with clean code and rich api (based on TweenX ideas), but maybe such library already exists and I just don’t know about it?

I’d love to see Actuate continuing to improve and evolve. I would like to try and see ways to make it more strictly typed to perform even faster, and we can continue to handle edge cases.

Multiple tweens on the same object are hard. I like the default “overwrite existing tweens” behavior, but obviously this doesn’t jive with a timeline-like sequence.

I have seen libraries that chain, but I think it’s worse (particularly if you want to change one link in the chain without affecting the timing of the others. For example:

Actuate.tween (view, 0.05, { offsetX: -5 }).ease (Linear.easeNone).pause (0.05).tween (0.05, { offsetX: 5 }).pause (0.05).tween (0.05, { offsetX: -5 }).pause (0.05).tween (0.05, { offsetX: 5 }).pause (0.05).tween (0.05, { offsetX: 0 });

I find this kind of code much worse :smile:

Actuate supports custom actuators, perhaps we could make one designed for timeline sequences, and some kind of better syntax for it

Actuate.timeline (view, [ 0.05, 0.05, 0.05, 0.05, 0.05 ], { offsetX: [ -5, 5, -5, 5, 0 ]).ease (Linear.easeNone);

There’s probably an even better way to do it

Open to ideas

I wish there was a port of TweenMax to haxe. I actually tried to port it ones, but the amount of errors created by as2hx discouraged me. I might give it another shot.

I’ve always been discouraged by the licensing model :slight_smile:

Yes, thats also… :blush:

Oh, sorry, Maybe I don’t understand correctly, but isn’t he saying here that it’s OK to fork and port the project to haxe?

Due to high demand and our available resources, all of our focus is on the JavaScript API.
We just don’t have the time to maintain and support another layer.

Perhaps you can work with Prass or fork what he has started.

That sounds like it, though the licensing (I’m sure) would be the same

TweenMap from GSAP is really great, but currently I’m think about other idea.
API example - https://gist.github.com/restorer/ff00b1d7f97cd3504033