Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes to allow the chaining of tweens, as well as (un)pausing and stopping tween animations. A TweenEnd event is still triggered at the end of each individual animation. Here's an example:
Example 1:
Crafty.e('2D, DOM, Color, Tween')
.attr({x:0, y:0, w:40, h:40})
.color('blue')
.tween({x: 100}, 50)
.tween({y: 100}, 50)
.tween({x: 20, y:50}, 50)
.tween({x: 300, rotation:720, alpha:0.0}, 50)
.bind('TweenEnd', function(k)
{
console.log('k: '+k);
});
Before this change it was possible to define simultaneous tweens with different time intervals (e.g., simultaneously change X from 0 to 100 and Y from 0 to 100, but the former in 100 frames and the latter in 200 frames (example 2). Now this is not possible as it was, but the same result can be obtained by adjusting the delta of each animation (example 3)
Example 2:
Crafty.e('2D, DOM, Color, Tween')
.attr({x:0, y:0, w:40, h:40})
.color('blue')
.tween({x: 100}, 100)
.tween({y: 100}, 200);
Example 3:
Crafty.e('2D, DOM, Color, Tween')
.attr({x:0, y:0, w:40, h:40})
.color('blue')
.tween({x: 100, y: 50}, 100)
.tween({y: 100}, 100);