Jump to content

How to slow down a tween animation


Raitch
 Share

Recommended Posts

I'm going to face a problem in my project where I wish to slow down active tweens based on dynamic conditions. From what I've found I could either use tween's `generateData()` or `pause()` and `resume()` to achieve this. However pausing and resuming might cause a lag-like effect, and `generateData()` requires me to reinvent tweens to a certain degree, plus if I wish to half the speed I need to generate in 120fps for instance, which might cause more unnecessary processing power when it's not needed.

 

Does anyone have any input regarding these solutions, or know a better one fitting my needs? Basically I need to slow down the animation of a tween so that the callback gets delayed and so on.

Link to comment
Share on other sites

  • 2 weeks later...

Yes, you have to listen for the onPause event. You can pause everything in tweenmax with TweenMax.pauseAll(). But I remember that I had some problems with timelines so I used 'globalTimeScale' instead. With this nothing gets paused, instead the time scale will actually be set to a very very small number as 0 is not allowed and the tweens will run very very very slow- like they are paused. But maybe you're not using timeline's at all- in this case try tweenmax#pauseAll first.

//pauseTweenMax.globalTimeScale(0)//resumeTweenMax.globalTimeScale(1)
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...