tweenjs / tween.js

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

Implement onBeforeRepeat #290

Closed shelbeniskb closed 4 years ago

shelbeniskb commented 8 years ago

is it possible to offer onRepeat? I need to change some state before the repeat cycle start, so I onRepeat is necessary, I also find TweenMax offer this function.

sole commented 8 years ago

Could you define a bit better how 'onRepeat' would work? Would it be executed before each repeat cycle? Would it maybe be better called onBeforeRepeat?

dalisoft commented 7 years ago

I like onBeforeRepeat and onBeforeReverse. Very good naming.

shelbeniskb commented 7 years ago

@sole onBeforeRepeat will be an chance for developer to change some state or value, for example, move a picture from A to B, we can change the picture before the next repeat happens.

sole commented 7 years ago

Ok, makes sense. I will update the title of the issue to reflect this :)

dalisoft commented 7 years ago

@shelbeniskb Maybe you looking for that? It implements repeat and reverse events, you can define via tween#on('reverse', (object) => { console.log(object); })

trusktr commented 4 years ago

An onRepeat feature has since been added. If that's not enough, definitely feel free to reply and we can re-open of make a new issue. :)