duckengine
Version:
A 2D Game Engine for the web.
55 lines (54 loc) • 2.09 kB
TypeScript
import Vector2 from '../math/vector2';
import Animation from './animation';
/**
* @class AnimationState
* @classdesc Creates a DuckEngine AnimationState
* @description The AnimationState Class. Holds information that can be used and added by StateMachine
* @since 2.0.0
*/
export default class AnimationState {
/**
* @memberof AnimationState
* @description The name/key of the AnimationState, used to identify between states, the same as the Animation
* @type string
* @since 2.0.0
*/
readonly key: string;
/**
* @memberof AnimationState
* @description The Animation to play by the AnimationState
* @type Animation
* @since 2.0.0
*/
animation: Animation;
/**
* @memberof AnimationState
* @description Determines whether the AnimationState auto advances to another AnimationState on completion
* @type boolean
* @since 2.0.0
*/
autoAdvance: boolean;
/**
* @memberof AnimationState
* @description The Vector2 position of the AnimationState on an imaginary 2D Plane, used to travel in between states by StateMachine
* @type Vector2
* @since 2.0.0
*/
vector: Vector2;
/**
* @memberof AnimationState
* @description An array of AnimationStates that are connected to this AnimationState, can only travel between connections
* @type
* @since 2.0.0
*/
connections: AnimationState[];
/**
* @constructor AnimationState
* @param {string} key The name/key of the AnimationState, used to identify between states, the same as the Animation
* @param {Animation} animation The Animation to play by the AnimationState
* @param {Vector2} vector The Vector2 position of the AnimationState on an imaginary 2D Plane, used to travel in between states by StateMachine
* @param {boolean} autoAdvance Determines whether the AnimationState auto advances to another AnimationState on completion
* @since 2.0.0
*/
constructor(key: string, animation: Animation, vector: Vector2, autoAdvance: boolean);
}