UNPKG

@flashport/flashport

Version:

FlashPort is a TypeScript 2D graphics library that largely replicates the Flash ActionScript 3.0 library

443 lines (442 loc) 20.6 kB
/** * Equations * Main equations for the Tweener class * * @author Zeh Fernando, Nate Chatellier * @version 1.0.2 */ export declare class Equations { /** * There's no constructor. * @private */ constructor(); /** * Registers all the equations to the Tweener class, so they can be found by the direct string parameters. * This method doesn't actually have to be used - equations can always be referenced by their full function * names. But "registering" them make them available as their shorthand string names. */ static init: () => void; /** * Easing equation function for a simple linear tweening, with no easing. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeNone: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quadratic (t^2) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInQuad: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quadratic (t^2) easing out: decelerating to zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutQuad: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quadratic (t^2) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutQuad: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quadratic (t^2) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInQuad: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a cubic (t^3) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInCubic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutCubic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a cubic (t^3) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutCubic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a cubic (t^3) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInCubic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quartic (t^4) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInQuart: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutQuart: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quartic (t^4) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutQuart: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quartic (t^4) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInQuart: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quintic (t^5) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInQuint: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutQuint: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutQuint: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a quintic (t^5) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInQuint: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInSine: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutSine: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutSine: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInSine: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInExpo: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutExpo: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutExpo: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInExpo: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInCirc: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutCirc: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutCirc: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInCirc: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param a Amplitude. * @param p Period. * @return The correct value. */ static easeInElastic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param a Amplitude. * @param p Period. * @return The correct value. */ static easeOutElastic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param a Amplitude. * @param p Period. * @return The correct value. */ static easeInOutElastic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param a Amplitude. * @param p Period. * @return The correct value. */ static easeOutInElastic: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent). * @return The correct value. */ static easeInBack: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent). * @return The correct value. */ static easeOutBack: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent). * @return The correct value. */ static easeInOutBack: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent). * @return The correct value. */ static easeOutInBack: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInBounce: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutBounce: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeInOutBounce: (t: number, b: number, c: number, d: number, p_params?: any) => number; /** * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration. * * @param t Current time (in frames or seconds). * @param b Starting value. * @param c Change needed in value. * @param d Expected easing duration (in frames or seconds). * @return The correct value. */ static easeOutInBounce: (t: number, b: number, c: number, d: number, p_params?: any) => number; }