Options
All
  • Public
  • Public/Protected
  • All
Menu

Image-base animation model.

Type parameters

  • T

Hierarchy

  • SpriteAnimator

Implements

Index

Constructors

Methods

  • getAngle(angle: number): number
  • getAnimationDuration(): number
  • getAnimationElapsedTime(): number
  • getAnimationFrameCount(): number
  • getAnimationFrameIndex(): number
  • Get the index of the current frame displayed by the animation

    Returns number

    newFrame The index of the frame being displayed

  • getAnimationIndex(): number
  • getAnimationName(): string
  • getAnimationSpeedScale(): number
  • getDirectionOrAngle(angle: number): number
  • hasAnimationEnded(): boolean
  • hasAnimationEndedLegacy(): boolean
  • invalidateFrame(): void
  • isAnimationPaused(): boolean
  • pauseAnimation(): void
  • resumeAnimation(): void
  • setAngle(oldAngle: number, angle: number): null | number
  • setAnimationElapsedTime(time: number): boolean
  • setAnimationFrameIndex(newFrameIndex: number): boolean
  • Change the current frame displayed by the animation

    Parameters

    • newFrameIndex: number

      The index of the frame to be displayed

    Returns boolean

  • setAnimationIndex(newAnimation: number): boolean
  • setAnimationName(newAnimationName: string): boolean
  • setAnimationSpeedScale(ratio: number): void
  • setDirectionOrAngle(oldValue: number, newValue: number): null | number
  • Change the angle (or direction index) of the object

    deprecated

    Parameters

    • oldValue: number
    • newValue: number

    Returns null | number

  • setOnFrameChangeCallback(callback: () => void): void
  • Register a listener to frame changes.

    It's useful for custom objects as they don't drive this class themselves.

    Parameters

    • callback: () => void

      Called each time getCurrentFrame changes.

        • (): void
        • Returns void

    Returns void

  • step(timeDelta: number): boolean
  • Update the current frame of the object according to the elapsed time on the scene.

    Parameters

    • timeDelta: number

      in seconds

    Returns boolean

Generated using TypeDoc