Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Animation<EventTypes>

Represents an animation.

Type parameters

  • EventTypes: string | symbol

Hierarchy

  • EventEmitter
    • Animation

Index

Constructors

constructor

  • new Animation(name?: undefined | string): Animation
  • Creates a new animation with the specified name.

    Parameters

    • Optional name: undefined | string

      Name for the animation.

    Returns Animation

Properties

Private Optional _ticker

_ticker: PIXI.Ticker

Private Optional _update

_update: undefined | ((...params: any[]) => void)

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: undefined | string

Name for the animation.

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 EventEmitter

EventEmitter: EventEmitterStatic

Static prefixed

prefixed: string | boolean

Methods

addListener

  • addListener(event: EventTypes, fn: ListenerFn, context?: any): this
  • Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

emit

  • emit(event: EventTypes, ...args: Array<any>): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: EventTypes
    • Rest ...args: Array<any>

    Returns boolean

eventNames

  • eventNames(): Array<EventTypes>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<EventTypes>

listenerCount

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

    Parameters

    • event: EventTypes

    Returns number

listeners

  • Return the listeners registered for a given event.

    Parameters

    • event: EventTypes

    Returns Array<ListenerFn>

off

  • off(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: undefined | false | true): this
  • Parameters

    • event: EventTypes
    • Optional fn: EventEmitter.ListenerFn
    • Optional context: any
    • Optional once: undefined | false | true

    Returns this

on

  • on(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

once

  • once(event: EventTypes, fn: ListenerFn, context?: any): this
  • Add a one-time listener for a given event.

    Parameters

    • event: EventTypes
    • fn: ListenerFn
    • Optional context: any

    Returns this

play

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

    Parameters

    • Default value ticker: Ticker = PIXI.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

  • Remove all listeners, or those of the specified event.

    Parameters

    Returns this

removeListener

  • removeListener(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: undefined | false | true): this
  • Remove the listeners of a given event.

    Parameters

    • event: EventTypes
    • Optional fn: EventEmitter.ListenerFn
    • Optional context: any
    • Optional once: undefined | false | true

    Returns this

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