tweenjs / es6-tween

ES6 version of tween.js
MIT License
186 stars 34 forks source link

Tween instantiation syntax? #18

Closed mikebolt closed 7 years ago

mikebolt commented 7 years ago

We should decide on a syntax for tween instantiation. We could use a syntax similar to the current version of tween.js, where options are added to tweens using chainable methods:

var myTween = new Tween.tween(object).to({a: 1, b: 2}).easing(TWEEN.Easing.Quadratic.In);

The other option is to use an options object:

var myTween = new Tween.tween(object, {'to': {a: 1, b: 2}, 'easing': TWEEN.Easing.Quadratic.In});

The above two options could both be available at the same time.

Please let me know what you think!

dalisoft commented 7 years ago

Looks interesting. I try EDIT: @mikebolt, this feature already available with to({x:'foo'}, {easing:...,delay:300,duration:2000}). See, let me know if something wrong

dalisoft commented 7 years ago

@mikebolt i answered to your question?