Options
All
  • Public
  • Public/Protected
  • All
Menu

The [[Texture]] object allows games built in Excalibur to load image resources. [[Texture]] is an Loadable which means it can be passed to a Loader to pre-load before starting a level or game.

Hierarchy

  • Gif

Implements

Index

Constructors

  • new Gif(path: string, color?: Color, bustCache?: boolean): Gif
  • Parameters

    • path: string

      Path to the image resource

    • color: Color = Color.Magenta

      Optionally set the color to treat as transparent the gif, by default Color.Magenta

    • bustCache: boolean = true

      Optionally load texture with cache busting

    Returns Gif

Properties

bustCache: boolean = true
color: Color = Color.Magenta
data: ImageSource[]

Data associated with a loadable

height: number

The height of the texture in pixels

path: string
width: number

The width of the texture in pixels

Accessors

  • get readCheckBytes(): number[]

Methods

  • isLoaded(): boolean
  • toAnimation(durationPerFrameMs: number): Animation
  • Transform the GIF into an animation with duration per frame

    Parameters

    • durationPerFrameMs: number

    Returns Animation