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

Constructors

  • 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

Optionally load texture with cache busting

color: Color = Color.Magenta

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

data: ImageSource[]

Data associated with a loadable

height: number

The height of the texture in pixels

path: string

Path to the image resource

width: number

The width of the texture in pixels

Accessors

Methods

  • Transform the GIF into an animation with duration per frame

    Parameters

    • durationPerFrameMs: number

    Returns Animation