An animation that can be run using the AnimationManager.

Subclasses need to implement update. Subclasses may override onStart and onStop to perform initialization and cleanup.

Hierarchy

  • Animation

Constructors

Accessors

Methods

Constructors

  • Creates a new Animation

    Parameters

    • duration: number

      The duration of the animation in milliseconds. Must be a strictly positive Number. When omitted, defaults to 1000. See duration

    Returns Animation

Accessors

  • get duration(): number
  • Returns the duration of this animation in milliseconds. The duration of this animation should be a strictly positive finite value.

    Returns number

  • set duration(duration): void
  • Parameters

    • duration: number

    Returns void

Methods

  • Called by AnimationManager when this animation is added to the manager and needs to starts playing.

    Can be overridden by Animation implementations (no need to call parent implementation).

    You can use this to perform initialization.

    Returns void

  • Called by AnimationManager when this animation is removed from the manager and needs to stops playing.

    Can be overridden by Animation implementations (no need to call parent implementation).

    You can use this to perform cleanup.

    Returns void

  • Updates the animation to a new time. Must be overridden by Animation implementations (no need to call parent implementation).

    Parameters

    • fraction: number

      the current fraction of the animation. A fraction of 0 indicates the start of the animation, while a fraction of 1 indicates the end of the animation.

    Returns void