Jump to content


Increasing/decreasing duration

Recommended Posts

Is there anyway to automatically increase or decrease the duration of any of the instances of these classes? I'm making a game where there are a lot of automated animations and events going on, and it'd be nice to give the player an opportunity to increase the speed of these animations if they don't want to sit through them all the time. So is there a way to do this automatically?




Link to comment
Share on other sites

Oh, you're gonna love the TweenMax.globalTimeScale property :)


Also notice that TweenMax instances each have a timeScale property as well. Heck, you can even tween the timeScale to gradually speed things up or slow them down. But the globalTimeScale property is perfect for what you're asking about.


TweenMax.globalTimeScale = 2; //makes things run twice as fast

Link to comment
Share on other sites

You can use timeScale on individual tweens or globalTimeScale on TweenMax. If you're using TimelineMax it also has a timeScale.


You could also manipulate the totalProgress property on TweenMax/TimelineMax, which works like the scrubber on a 'real' timeline.


timeScale: http://www.greensock.com/as/docs/tween/ ... #timeScale


globalTimeScale: http://www.greensock.com/as/docs/tween/ ... lTimeScale


totalProgress: http://www.greensock.com/as/docs/tween/


/edit: .. bah, i was too slow ;)

Link to comment
Share on other sites

Oh wow thanks! I looked in the docs, but I just kind of skimmed over them so I guess I missed that!


This is excellent :-D



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.