Class EasingCurve

The EasingCurve provides a convenient API to evaluate an easing function.

Constructors

  • Creates a new easing curve with a custom easing function;

    Parameters

    • easingFunction: ((value: number) => number)

      The easing function. Given an input between [0, 1] varying linearly over time, the function should return another value in the range of [0, 1] that eases the input value.

        • (value): number
        • Parameters

          • value: number

          Returns number

    Returns EasingCurve

Properties

evaluate: ((value: number) => number)

Evaluates the easing function.

Type declaration

    • (value): number
    • Parameters

      • value: number

        The current progress of the animation. Must be between [0, 1].

      Returns number

      The evaluated value.

inBounce: EasingCurve
inCubic: EasingCurve
inElastic: EasingCurve
inOutBounce: EasingCurve
inOutCubic: EasingCurve
inOutElastic: EasingCurve
inOutQuadratic: EasingCurve
inOutQuartic: EasingCurve
inQuadratic: EasingCurve
inQuartic: EasingCurve
linear: EasingCurve

Linearly interpolates between the starting value and the ending value.

Placeholder for no active animation

outBounce: EasingCurve
outCubic: EasingCurve
outElastic: EasingCurve
outQuadratic: EasingCurve
outQuartic: EasingCurve

A step function that returns the start value if the time is < 0.5 otherwise the end value.

Methods