Base class for all GreenSock easing equations. In its simplest form, an Ease is responsible for translating linear time (typically represented as a number between 0 and 1 where 0 is the beginning, 0.5 is halfway complete, and 1 is the end) into a value that has a different rate of change but still starts at 0 and ends at 1. In the GreenSock platform, eases are used to give tweens/animations the look and feel that the animator desires. For example, a ball rolling to a stop would decelerate over time (easeOut) rather than using a linear velocity. An Elastic ease could be used to make an object appear as though it is loosely attached somewhere and is snapping into place with loose (or tight) tension.
All Ease instances have a getRatio()
method that is responsible for the translation of the progress ratio which the tween typically feeds in. End users almost never need to directly feed any values to or get any values from an Ease instance - the tweens will do that internally.
The base Ease class handles most of the common power-based easeIn/easeOut/eaesInOut calculations (like Linear, Quad, Cubic, Quart, Quint, and Strong) internally. You can define a separate function that uses what was considered the 4 standard easing parameters by Adobe and many others (time, start, change, duration) and Ease will serve as a proxy in order to maximize backwards compatibility and usability. For example, if you have a custom method that you created like this:
function myEase(t, s, c, d) {
return s+(t=t/d);
}
You could still use that by wrapping Ease around it like this:
TweenLite.to(obj, 5, {x:600, ease:new Ease(myEase)});
In the above example, the anytime the Ease's getRatio()
method is called, it would feed the first parameter as a ratio between 0 and 1 and the rest of the 3 parameters would always be 0, 1, 1. This is all done transparently by TweenLite/TweenMax, so you really shouldn't need to worry about this.