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

constructor

  • new Resource<T>(path: string, responseType: "" | "arraybuffer" | "blob" | "document" | "json" | "text", bustCache?: boolean): Resource<T>
  • Type parameters

    • T

    Parameters

    • path: string

      Path to the remote resource

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

      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

bustCache: boolean = true

data

data: T = null

Data associated with a loadable

events

events: EventDispatcher<any> = ...

logger

logger: Util.Logger = ...

path

path: string

responseType

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

Methods

isLoaded

  • isLoaded(): boolean

load

  • load(): Promise<T>