Options
All
  • Public
  • Public/Protected
  • All
Menu

An optimized animation player for apngs.

Hierarchy

  • AnimationPlayer

Index

Constructors

constructor

  • Parameters

    • cacheKeyOrUrl: string

      key name of the apng in Phaser cache or the url of the apng to load

    • x: number

      x (left) coord to draw apng

    • y: number

      y (top) coord to draw apng

    • Default value options: IAnimationPlayerOptions = null

      apng options

    Returns AnimationPlayer

Accessors

currentFrameNumber

  • get currentFrameNumber(): number
  • Returns number

image

  • get image(): Image
  • Phaser image that the animation is rendered to

    Returns Image

isLooping

  • get isLooping(): boolean
  • Returns boolean

isPaused

  • get isPaused(): boolean
  • Returns boolean

isPlaying

  • get isPlaying(): boolean
  • Returns boolean

isPrerendered

  • get isPrerendered(): boolean
  • Returns boolean

onLoad

  • get onLoad(): Signal
  • Event that fires when an animation has successfully loaded

    Returns Signal

onLoadFail

  • get onLoadFail(): Signal
  • Event that fires when an animation failed to load

    Returns Signal

onLoop

  • get onLoop(): Signal
  • Returns Signal

onPause

  • get onPause(): Signal
  • Returns Signal

onPlay

  • get onPlay(): Signal
  • Returns Signal

onResume

  • get onResume(): Signal
  • Returns Signal

onStop

  • get onStop(): Signal
  • Returns Signal

playSegment

  • get playSegment(): { begin: number; end: number }
  • Returns { begin: number; end: number }

    • begin: number
    • end: number

totalDuration

  • get totalDuration(): number
  • Returns number

Methods

destroy

  • destroy(): void
  • Destroy the animation (stop if playing and delete any resources)

    Returns void

hide

  • hide(): void
  • Hide the animation

    Returns void

pause

  • pause(): void
  • Pause the animation

    Returns void

play

  • play(): void
  • Start playing the animation

    Returns void

resume

  • resume(): void
  • Resume the animation

    Returns void

show

  • show(): void
  • Show the animation

    Returns void

stop

  • stop(): void
  • Stop the animation

    Returns void