Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AnimationController

Abstract base class for animation controllers.

Manages timing, easing, looping, and basic control functions such as start, pause, resume, and cancel. This generic controller can be extended to support various animation types (e.g., for paths, markers, or camera movements).

The actual animation logic should be implemented in the updateFrame\(t\) method by subclasses.

Hierarchy

Index

Methods

cancel

  • cancel(): void
  • Cancel the animation.

    Returns void

complete

  • complete(): Promise<void>
  • Returns a promise that resolves when the animation completes.

    Returns Promise<void>

Protected frame

  • frame(now: number): void
  • Internal frame handler. Calls updateFrame(t) which should be implemented by subclasses.

    Parameters

    • now: number

    Returns void

isRunning

  • isRunning(): boolean
  • Check if the animation is running.

    Returns boolean

onComplete

  • onComplete(cb: () => void): void
  • Set a callback to be invoked when the animation completes.

    Parameters

    • cb: () => void
        • (): void
        • Returns void

    Returns void

pause

  • pause(): void
  • Pause the animation.

    Returns void

resume

  • resume(): void
  • Resume a paused animation.

    Returns void

start

  • start(): void
  • Start or restart the animation.

    Returns void

Protected updateFrame

  • updateFrame(t: number): void
  • Override this in subclasses to implement animation logic.

    Parameters

    • t: number

      normalized time [0..1] after easing

    Returns void

Generated using TypeDoc