tweenjs / tween.js

JavaScript/TypeScript animation engine
https://tweenjs.github.io/tween.js/
Other
9.82k stars 1.41k forks source link

Is it possible to tween values relatively? #72

Closed endel closed 11 years ago

endel commented 11 years ago

Supose that I have something like:

var position = new Vec2(50, 50);

And I want to move the thing 10 to the right.

TWEEN.Tween(position, {x: position.x + 10}).start()

On GreenSock's tweening engine for Flash, it's possible to use relative values, declaring the offset as a string, like:

TWEEN.Tween(position, {x: "+10"}).start()

Do you guys have something against this approach?

sole commented 11 years ago

Yes, currently that's not possible.

We don't have anything against the approach a priori. It's only that we haven't needed it, and no one has programmed the feature either :-)