Class: Animator

hcje/sprites.Animator()

Animator class for animating objects that implement the AnimationTarget interface. When activated, the Animator requests animation frames and calls update on its children.

Constructor

new Animator()

Construct the animator.

Source:

Members

active :boolean

The current active state. When true, animation frames will start to be requested and children updated. Note if the animation has been paused even if the active property is set true. The paused state overrides the active state.

Type:
  • boolean
Source:

Methods

addTarget(target)

Add target for animation.

Parameters:
Name Type Description
target module:hcje/sprites~AnimationTarget

Animation target to update.

Source:
Throws:

Thrown if the child does not implement the module:hcje/sprites~AnimationTarget interface.

Type
Error

clear()

Clear the animator. This kills all children and deactivates the animator.

Source:

killTarget(target)

Destroy the target. This kills the target and removes it from the animator.

Parameters:
Name Type Description
target module:hcje/sprites~AnimationTarget

Animation target to kill.

Source:

pause()

Pause the animator. The active property is unchanged. The allows the pause and resume methods to be safely called without modifying the active state of the animator.

Source:

resume()

Resume (unpause) the animator. This will resume animations. Note the animations may still not actually start if the animator is not active. If the animator is not paused, the call is ignored.

Source: