Represents an Animation of an Element

Animations can be created by calling Element.animation on any Element.

See Animations for more information.

Hierarchy (View Summary)

Constructors

Properties

Animation manager

STATES: { FINISHED: 4; IDLE: 0; PAUSED: 5; PLAYING: 1; STOPPED: 3; STOPPING: 2 }

Animation State Enum

Type declaration

  • FINISHED: 4

    Animation has finished playing (uninterrupted from from start to finish)

  • IDLE: 0

    Animation has never been played

  • PAUSED: 5

    Animation is paused

    Entered by a call to Animation.pause while the animation is PLAYING.

  • PLAYING: 1

    Animation is currently playing

    Entered by a call to Animation.play

  • STOPPED: 3

    Animation has finished its stop animation (if there was one)

  • STOPPING: 2

    Animation is currently executing its stop animation

    The stop animation is determined by stopMethod.

    Entered by a call to Animation.stop

Accessors

  • get delayLeft(): number
  • Gets the amount of delay left (in seconds) before the animation starts

    Returns number

  • get p(): number
  • Gets the current progress point

    Returns number

    This is always a value betwen 0.0 and 1.0

Methods

  • If currently playing, fast-forward the animation to the end. If stopping, fast forward it to the end of the stop animation.

    Returns void

  • Returns ‘true’ if the animation is currently progressing (playing or stopping)

    Returns boolean

  • If playing (or stopped) then start. If paused, continue. If playing or finished, ignored.

    Returns void

  • Manually progress the animation forward by dt seconds

    Parameters

    • dt: number

    Returns void