Jump to content
GreenSock

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

CustomWiggle

.getRatio()

.getRatio( progress:Number ) : CustomEase

Converts a linear progress value (0-1) into the corresponding eased value.

Parameters

progress: Number

Converts a linear progress value (0-1) into the corresponding eased value.

Details

Converts a linear progress value (0-1) into the corresponding eased value. In other words, if the tween is halfway done (progress of 0.5), you'd get the corresponding ease ratio like this:


//create a CustomEase with an ID of "hop"
var ease = CustomEase.create("hop", "M0,0 C0,0 0.056,0.445 0.175,0.445 0.294,0.445 0.332,0 0.332,0 0.332,0 0.414,1 0.671,1 0.991,1 1,0 1,0");

//get the eased ratio at the progress of 0.5 (halfway done):
var value = ease.getRatio(0.5);

See CustomEase for more details.

Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
×