The Resource type allows games built in Excalibur to load generic resources. For any type of remote resource it is recommended to use Resource for preloading.

Type Parameters

  • T

Hierarchy

  • Resource

Implements

Constructors

  • Type Parameters

    • T

    Parameters

    • path: string

      Path to the remote resource

    • responseType: "" | "text" | "arraybuffer" | "blob" | "document" | "json"

      The type to expect as a response: "" | "arraybuffer" | "blob" | "document" | "json" | "text";

    • bustCache: boolean = true

      Whether or not to cache-bust requests

    Returns Resource<T>

Properties

bustCache: boolean = true

Whether or not to cache-bust requests

data: T = null

Data associated with a loadable

events: EventDispatcher<any> = ...
logger: Util.Logger = ...
path: string

Path to the remote resource

responseType: "" | "text" | "arraybuffer" | "blob" | "document" | "json"

The type to expect as a response: "" | "arraybuffer" | "blob" | "document" | "json" | "text";

Methods

  • Begin loading the resource and returns a promise to be resolved on completion

    Returns Promise<T>