Jump to content
GreenSock

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

about onUpdate and RoundPropsPlugin

Recommended Posts

Hi,

 

I'm fairly good user of the lib, which i find awesome. thanks ;)

I'm having this case right now where i tween a plain numeric value, which i round with the roundProps plugin, and to which i react whenever there's an update with the onUpdate() hook. As the tween runs, the onUpdate() function is fired for every single step on the way, ignoring the fact that the value is rounded in post treatment by the plugin, firing unnecessary onUpdates on the way. Is there a way to prevent that ?

 

Quite simple example :

 

let wrapper = { index: 0, length : 0 };

TweenMax.killAll();

TweenMax.to(wrapper, 2, {
  length: 10
, roundProps: 'length'
, onUpdate: value => {
    console.log(wrapper.length)
  }
})

 

Thanks for the help,

J.

  • Like 1
Link to post
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.

×