An interface describing loadable resources in Excalibur. Built-in loadable resources include Texture, Sound, and a generic Resource.

Hierarchy

  • ImageSource

Implements

Constructors

Properties

Accessors

Methods

Constructors

  • The path to the image, can also be a data url like 'data:image/'

    Parameters

    • path: string

      {string} Path to the image resource relative from the HTML document hosting the game, or absolute

    • bustCache: boolean = false

      {boolean} Should excalibur add a cache busting querystring?

    • Optional filtering: ImageFiltering

      {ImageFiltering} Optionally override the image filtering set by EngineOptions.antialiasing

    Returns ImageSource

Properties

data: HTMLImageElement = ...

Access to the underlying html image element

filtering: ImageFiltering
path: string

{string} Path to the image resource relative from the HTML document hosting the game, or absolute

ready: Promise<HTMLImageElement> = ...

Promise the resolves when the image is loaded and ready for use, does not initiate loading

Accessors

  • get bustCache(): boolean
  • Should excalibur add a cache busting querystring? By default false. Must be set before loading

    Returns boolean

  • set bustCache(val: boolean): void
  • Parameters

    • val: boolean

    Returns void

Methods

  • Begins loading the image and returns a promise that resolves when the image is loaded

    Returns Promise<HTMLImageElement>