Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an animation.

Hierarchy

  • EventEmitter
    • Animation

Index

Constructors

constructor

  • Creates a new animation with the specified name.

    Parameters

    • Optional name: string

      Name for the animation.

    Returns Animation

Properties

Readonly Abstract duration

duration: number

The duration (in seconds) of this animation.

loop

loop: boolean = false

A value indicating if the animation is looping.

Optional name

name?: string

Abstract position

position: number

The current position (in seconds) of this animation.

speed

speed: number = 1

The speed that the animation will play at.

Static prefixed

prefixed: string | boolean

Methods

addListener

  • addListener(event: string | symbol, fn: ListenerFn, context?: any): Animation
  • Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Animation

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): ListenerFn[]
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

    Returns ListenerFn[]

off

  • off(event: string | symbol, fn?: ListenerFn, context?: any, once?: boolean): Animation
  • Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns Animation

on

  • on(event: string | symbol, fn: ListenerFn, context?: any): Animation
  • Add a listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Animation

once

  • once(event: string | symbol, fn: ListenerFn, context?: any): Animation
  • Add a one-time listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Animation

play

  • play(ticker?: Ticker): void
  • Starts playing the animation using the specified ticker.

    Parameters

    • ticker: Ticker = Ticker.shared

      The ticker to use for updating the animation. If a ticker is not given, the shared ticker will be used.

    Returns void

removeAllListeners

  • removeAllListeners(event?: string | symbol): Animation
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns Animation

removeListener

  • removeListener(event: string | symbol, fn?: ListenerFn, context?: any, once?: boolean): Animation
  • Remove the listeners of a given event.

    Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns Animation

stop

  • stop(): void

update

  • update(delta: number): void
  • Updates the animation by the specified delta time.

    Parameters

    • delta: number

      The time in seconds since last frame.

    Returns void

Generated using TypeDoc