Class: Animation

bitmap. Animation


new Animation(srcXSequence, srcYSequence, step, loop)

Describes the src positions and timing of spritesheet a animation

Parameters:
Name Type Argument Default Description
srcXSequence Array | Integer

A list of (or singular) srcX position(s)

srcYSequence Array | Integer

A list of (or singular) srcY position(s)

step Integer <optional>
2

The amount of frames between each frame step. This is based on
requestAnimationFrame's 60fps rate. eg: 2 would animate @ 30fps, 3 @ 15fps
etc.

loop loop <optional>
false

If true, will start the sequence at the initial position when complete and run
until stopped

Author:
  • Chris Peters
Source:

Methods


play(loop)

Parameters:
Name Type Argument Description
loop Boolean <optional>

Whether or not to loop in this sequence instance

Source:

stop()

Stops the current animation. Called automatically when sequence ends and loop set to false

Source:

update()

Source:
Returns:

If animation not playing returns null else returns object containing current srcX/Y values

Type
null | Object