Jump to content
Search Community

What is the code to tween a timeScale for?

Jeremy Rudd test
Moderator Tag

Recommended Posts

Hi,

 

I've found this code inside the initTweenVals() function of GSAP v10. Why is it needed? I'm not using timeScale anywhere, but is the tweening engine using it for something?



if (vars.timeScale != undefined && target.hasOwnProperty("timeScale")) {
tweens[tweens.length] = new TweenInfo(target, "timeScale", target.timeScale, vars.timeScale - target.timeScale, "timeScale", false); //[object, property, start, change, name, isPlugin]
}

Thanks

Link to comment
Share on other sites

If I remember correctly (and that code is many years old), it was intended to allow you to set timeScale directly through the vars parameter, but if you try tweening an object (like another tween) that has a timeScale property, it would assume you meant to actually tween that value instead of setting it on the tween instance itself.

 

I'm really curious - why are you so interested in such an old version of the platform? Many architectural improvements have been made since then.

  • Like 1
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.
×
×
  • Create New...