Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
mikel

Does .time () take into account the .timeScale?

Recommended Posts

Hey,

 

Last days there was a post to the web http://antonin.space/alcara/ - not there anymore.

 

This page contains many little neatly arranged animations - the wonderful world of pixi.

 

Here's just a try ...

 

See the Pen JQdmKJ#0 by mikeK (@mikeK) on CodePen

 

My question: Why does .time () not consider the current .timeScale (line 112 ff) ?

 

Best regards
Mikel
 

See the Pen JQdmKJ by mikeK (@mikeK) on CodePen

Link to comment
Share on other sites

Hey @mikel :)

 

I'm not sure I understand the question, but changing the timeScale() of an animation won't change the duration.

 

A 1 second animation with timeScale(4) will still have a duration of 1 second so the playhead time() will still travel from 0 to 1 and not 0 to 0.25. 

 

Does that help at all?

  • Like 3
Link to comment
Share on other sites

I'm a little fuzzy on what you're asking too, but @PointC is correct - timeScale() merely affects the way that its parent timeline plays it. If you want to calculate its duration in a way that factors in timeScale, you'd simply do: 

 

var scaledDuration = animation.duration() / animation.timeScale();

 

  • Like 3
Link to comment
Share on other sites

 

Sorry - I mistook current time for effective duration.
@GreenSock:  Thank you for the formula.

 

Kind regards

Mikel

  • 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.
×