tweenjs / tween.js

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

Tween.js - Needs Some methods! #135

Closed dalisoft closed 9 years ago

dalisoft commented 10 years ago

Hi, all! Tween.js - A High-performance, Cross Browser, Minimal, Lightweight, Popular and Powerful tweening engine. But needs more methods, like GSAP. If in Tween.js have more methods ( see Notes N1 ) and Anything tweening ( see Notes N2 ) available Tween.js very powerful and more developers and game makers uses Tween.js

For example, i'm have timeScale method code.

var _timeScale = 1;
/* if  _timeScale = 2 duration slower 2x than current duration */
this.timeScale = function ( scale ) {
_timeScale = scale;
return this;
}
.......
this.update = function ( time ) {
.........
var elapsed = (time - _startTime) / (_duration / _timeScale);
.......
return this;
}

Comments:

  1. Current i writed timeScale code.
  2. Play and Pause code is have in Issues, https://github.com/sole/tween.js/issues/15

Notes: N1: Reverse ( except yoyo ), Pause ( #15 ), Play ( #15 ), Restart, Seek, timeScale ( #135 ) N2.

var tween = new TWEEN.Tween({x:[10, 50, 100, 0]})
.to({x:[35, 35, 10, 5]})
.onUpdate(function(){ node.style.borderRadius = this.x.join("px ") + "px"; })
.start(); 
sole commented 10 years ago

Hi @dalisoft - thanks for your interest.

The way we add new features into tween.js is mostly via people sending PRs, because I simply don't have the time to implement all the features people want.

In this case I'm not sure if you want me to implement those features or are asking about them, or complaining...? :-) Also I do not know what GSAP is, sorry.

dalisoft commented 10 years ago

Sorry for writing shortword GSAP ( GreenSock Animation Platform, http://greensock.com ). I'm sending PR ( Pull Request ) to Tween.js for powerful and/or total controlling. I'm always like and using Tween.js instead of any libraries, it's a very high-performance and device accelaration powered. Thank you for answer. Sorry for my bad english.

sole commented 10 years ago

Hey, don't worry about your English. We're communicating which is what matters here :-) I'll comment on the actual PR you sent #136

dalisoft commented 10 years ago

Hi @sole I'm added new PR, please merge for extend tween.js features. Thanks!