Create an Animation given a list of frames in AnimationOptions

To create an Animation from a SpriteSheet, use Animation.fromSpriteSheet

Hierarchy

Implements

Constructors

Properties

events: EventDispatcher<any> = ...
frameDuration: number = 100
frames: Frame[] = []
id: number = ...
opacity: number = 1

Gets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).

showDebug: boolean = false

Gets or sets wether to show debug information about the graphic

strategy: AnimationStrategy = AnimationStrategy.Loop
timeScale: number = 1
tint: Color = null
transform: AffineMatrix = ...

Accessors

  • get currentFrameIndex(): number
  • Returns the current frame index of the animation

    Returns number

  • get done(): boolean
  • Returns true if the animation is done, for looping type animations ex.AnimationStrategy.PingPong and ex.AnimationStrategy.Loop this will always return false

    See the ex.Animation.canFinish() method to know if an animation type can end

    Returns boolean

  • get flipHorizontal(): boolean
  • Gets or sets the flipHorizontal, which will flip the graphic horizontally (across the y axis)

    Returns boolean

  • set flipHorizontal(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get flipVertical(): boolean
  • Gets or sets the flipVertical, which will flip the graphic vertically (across the x axis)

    Returns boolean

  • set flipVertical(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get height(): number
  • Gets or sets the height of the graphic (always positive)

    Returns number

  • get rotation(): number
  • Gets or sets the rotation of the graphic

    Returns number

  • set rotation(value: number): void
  • Parameters

    • value: number

    Returns void

  • get width(): number
  • Gets or sets the width of the graphic (always positive)

    Returns number

Methods

  • Jump the animation immediately to a specific frame if it exists

    Parameters

    • frameNumber: number

    Returns void

  • Reset the animation back to the beginning, including if the animation were done

    Returns void

  • Reverses the play direction of the Animation, this preserves the current frame

    Returns void

  • Called internally by Excalibur to update the state of the animation potential update the current frame

    Parameters

    • elapsedMilliseconds: number

      Milliseconds elapsed

    • idempotencyToken: number = 0

      Prevents double ticking in a frame by passing a unique token to the frame

    Returns void