tweenjs / es6-tween

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

Is there some kind of 'complete' event or onComplete method for es6-tween? #49

Closed songololo closed 6 years ago

songololo commented 6 years ago

Issue

Issue name

Is there some kind of 'complete' event or onComplete method for es6-tween?

Issue description

I can't seem to find anything in the documentation and attempts at using a .on('complete...) method don't seem to work.

Related

This issue is related to

Example

I'm trying to do something like this:

new Tween({ opacity: 0.85})
            .to({ opacity: 1 }, 500)
            .easing(Easing.Quadratic.InOut)
            .reverse(true)
            .on('update', ({ opacity }) => {
              do something...
            })
            .on('complete', () => {
              do something once tween completes
            })
dalisoft commented 6 years ago

Hi @shongololo

Here online demo i'm pasted your code and fixed these:

  1. Set autoPlay(true) for automatic running tweens loop
  2. Call .start() for running tween

Node: .reverse() may not work as excepted, i haven't much time to fix these issues for now