Hey guys,
since Josh was so nice as to remove the 'GTween' dependency from Feathers, I added a few new features to the animation package that make a lot of things easier to accomplish. Thanks to Josh for pushing me to finally make those changes! 😉
Here are the new features:
1) 'repeatCount' and 'reverse' properties
It is now possible to repeat a tween several times with the 'repeatCount' property. If 'reverse' is false, the tween will restart on each repetition; otherwise, it will turn around, like a yo-yo.
2) 'nextTween' property
You can now specify another tween that will be started (i.e. added to the same juggler) as soon as the tween is complete. This makes it very easy to chain tweens together.
3) Convenience method
While the separation between tween and juggler is a very powerful tool, it sometimes just stands in the way, forcing you to write a lot of code for simple tasks. That's why I have added a convenience method to the Juggler that allows you to work with Starling tweens in almost the same way as it's done by other tweening libries (e.g. GTween or Tweener). Here's a sample call:
Starling.juggler.tween(object, 1.5, {
transition: Transitions.EASE_IN_OUT,
repeatCount: 3,
onComplete: function():void { startButton.enabled = true; },
x: 300,
y: 360,
rotation: deg2rad(90)
});
This is equivalent to the following code:
var tween:Tween = new Tween(object, 1.5, Transitions.EASE_IN_OUT);
tween.repeatCount = 3;
tween.onComplete = function():void { startButton.enabled = true; };
tween.moveTo(300, 360);
tween.animate("rotation", deg2rad(90));
Starling.juggler.add(tween);
That should provide a very simple transition for people who've used such libraries in the past.
I hope you like the new features! Have fun! =)