API Docs for: 0.0.2
Show:

Atlantis.SpriteAnimator Class

Module: Engine
Parent Module: Atlantis

A SpriteAnimator is a class that is used to play sprite animations. A sprite has many animation that are stored in a dictionary[name] => spriteAnimation

Constructor

Atlantis.SpriteAnimator

()

Methods

add

(
  • name
  • framesIndex
  • framerate
)

Add an animation to the animator.

Parameters:

  • name String

    The name of the animation.

  • framesIndex Array

    An array of indices that compose the animation on the spritesheet.

  • framerate Number

    The desired framerate for this animation.

checkForIDLEAnimation

()

getCurrentAnimation

()

initialize

(
  • animationWidth
  • animationHeight
  • textureWidth
  • textureHeight
)

Initialize the animator

Parameters:

  • animationWidth Number

    The width of a frame.

  • animationHeight Number

    The height of a frame.

  • textureWidth Number

    The width of the texture (spritesheet).

  • textureHeight Number

    The height of the texture (spritesheet).

play

(
  • animationName
)

Play an animation.

Parameters:

  • animationName String

    The name of the animation to play.

update

(
  • gameTime
  • lastDistance
)

Parameters: