Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Constructors

  • new Resource<T>(path: string, responseType: "" | "text" | "arraybuffer" | "blob" | "document" | "json", bustCache?: boolean): Resource<T>
  • 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
data: T = null

Data associated with a loadable

events: EventDispatcher<any> = ...
logger: Util.Logger = ...
path: string
responseType: "" | "text" | "arraybuffer" | "blob" | "document" | "json"

Methods

  • isLoaded(): boolean
  • load(): Promise<T>