starling-framework
Version:
A fast, productive library for 2D cross-platform development.
51 lines • 2.18 kB
TypeScript
declare namespace starling.animation {
/**
* The Transitions class contains static methods that define easing functions.
* * Those functions are used by the Tween class to execute animations.
* *
* * <p>Here is a visual representation of the available transitions:</p>
* * <img src="http://gamua.com/img/blog/2010/sparrow-transitions.png"/>
* *
* * <p>You can define your own transitions through the "registerTransition" function. A
* * transition function must have the following signature, where <code>ratio</code> is
* * in the range 0-1:</p>
* *
* * <pre>function myTransition(ratio:Float):Float</pre>
* *
* * <p>Also have a look at the "BezierEasing" class, which provides a very easy way of
* * adding custom transitions.</p>
* *
* * @see starling.animation.BezierEasing
* * @see starling.animation.Juggler
* * @see starling.animation.Tween
*
*/
export class Transitions {
static readonly LINEAR = "linear";
static readonly EASE_IN = "easeIn";
static readonly EASE_OUT = "easeOut";
static readonly EASE_IN_OUT = "easeInOut";
static readonly EASE_OUT_IN = "easeOutIn";
static readonly EASE_IN_BACK = "easeInBack";
static readonly EASE_OUT_BACK = "easeOutBack";
static readonly EASE_IN_OUT_BACK = "easeInOutBack";
static readonly EASE_OUT_IN_BACK = "easeOutInBack";
static readonly EASE_IN_ELASTIC = "easeInElastic";
static readonly EASE_OUT_ELASTIC = "easeOutElastic";
static readonly EASE_IN_OUT_ELASTIC = "easeInOutElastic";
static readonly EASE_OUT_IN_ELASTIC = "easeOutInElastic";
static readonly EASE_IN_BOUNCE = "easeInBounce";
static readonly EASE_OUT_BOUNCE = "easeOutBounce";
static readonly EASE_IN_OUT_BOUNCE = "easeInOutBounce";
static readonly EASE_OUT_IN_BOUNCE = "easeOutInBounce";
/**
* Returns the transition function that was registered under a certain name.
*/
static getTransition(name: string): (arg0: number) => number;
/**
* Registers a new transition function under a certain name.
*/
static register(name: string, func: (arg0: number) => number): void;
}
}
export default starling.animation.Transitions;