Easing
The Easing class contains every easing method, as well as a number of static methods used to easily generate new Easing objects and a handful of predefined Easing objects for easy accessibility.
Constructor
Easing(inFunction: (t: number) => number)
The constructor for Easing
objects takes an inFunction, the function used to calculate eased time into the curve. The out and inOut functions can be generated using the given in function.
An easing function should ideally return a value equal to or approximately 0 at time = 0, and a value equal to or approximately 1 at time = 1.
Methods
in(t: number): number
The function used to calculate eased time into the curve
The in
method is evaluated over the first half of the curve, when time < 0.5, and will usually have upwards concavity
out(t: number): number
The function used to calculate eased time out of the curve, generated using the in function
The out
method is evaluated over the first half of the curve, when time > 0.5, and will usually have downwards concavity
inOut(t: number): number
The function used to calculate the eased time into the function (where time < 0.5) and subsequently out of the function (where time > 0.5)
inverse(): Easing
Returns a new Easing
object for which the in and out functions are reversed
Static Methods
inOut(inEasing: Easing, outEasing: Easing, t: number): number
Calculates the in-out eased time of the curve using two different Easing
objects for the in and out functions
interpolate(inEasing: Easing, outEasing: Easing, t: number, smoothing: number = 0.25): number
Calculates the in-out eased time of the curve using two different Easing
objects for the in and out functions with a smooth the transition between the in and out function
Calling Easing.interpolate
with a smoothing value of 0 will return the equivalent of Easing.inOut
Last updated