Closed gilbox closed 11 years ago
Hi @gilbi
Thanks for your comments - hopefully I can answer some of them:
// Create a tween, and pause it
var tween1 = createjs.Tween.get(target).to({y:100}, 2000);
tween1.setPaused(true);
// Create another tween. When it is done its first "to" action, it will call play on the first tween.
createjs.Tween.get(target)
.to({x:100}, 2000)
.play(tween1);
Cheers.
@lannymcnie,
Thank you for your illuminating explanation re: setPaused.
Here is an example where set(...) does not do what I would expect:
(In the example above, I want the text to move from x=200 to x=0 in 2000ms.)
Definitely a bug or unexpected behaviour.
Looks like properties updated using the set() API get overridden by tween properties, which are stored in an internal look up to manage the tween.
A workaround would be to use a 0-duration tween instead of a set - but we will look into fixing this issue if possible.
createjs.Tween.get(target).to({x:100}, 0).to(etc...)
Thanks for the report!
I distilled the example down to this to show the issue http://jsfiddle.net/lannymcnie/s6Rxe/22/
I discussed this issue internally, and its behaving as expected. TweenJS uses managed properties to make tweens deterministic. The "set" method will only set properties once, but managed properties will always override them. To do an instant set of a managed property, use a "to" call (as in the demo above).
Thanks for your comments.
My frustrations (v0.4.0):
Why can't I do this:
t1.play(); // doesn't work
instead of this:
t1.setPaused(false); // works
Am I just being dense or do others share my frustrations?