Class: SpriteSheet

SpriteSheet

SpriteSheet

new SpriteSheet(parameters) → {SpriteSheet}

A SpriteSheet is a DisplayObject that plays back animations.
Parameters:
Name Type Description
parameters Object An object initializer that may must contain: width height mainTexture But may also contain any values appropriate for a DisplayObject.
Source:
Returns:
Type
SpriteSheet

Methods

addAnimation(animationData)

Adds an Animation object to this SpriteSheet.
Parameters:
Name Type Description
animationData Animation The Animation instane to add.
Source:

getBlendCurve() → {AnimationCurve}

Returns the AnimationCurve instance used for blending between frames.
Source:
Returns:
Type
AnimationCurve

getCurrentAnimation() → {Animation}

Retrieves the currently playing Animation.
Source:
Returns:
Type
Animation

getCurrentFrame() → {number}

Returns the number of the frame currently playing.
Source:
Returns:
Type
number

removeAnimationByName(animationName)

Removes an Animation instance by name.
Parameters:
Name Type Description
animationName String The name of the Animation to remove.
Source:

setCurrentAnimationByName(animationName)

Sets the current Animation to play back by name.
Parameters:
Name Type Description
animationName String The name of the Animation to play.
Source:

setCurrentFrame(value)

Sets the current frame.
Parameters:
Name Type Description
value Number The frame number to play.
Source:

setCurrentTime(value)

Rather than setting the frame number, the time may also be set, in which case, the frame number is derived.
Parameters:
Name Type Description
value
Source:

update(dt)

Updates the SpriteSheet. This method motors the animation.
Parameters:
Name Type Description
dt Number The time, in seconds, since the last update was called.
Source: