Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Advanced: Custom loadables

You can implement the ILoadable interface to create your own custom loadables.

This is an advanced feature, as the Resource class already wraps logic around blob/plain data for usages like JSON, configuration, levels, etc through XHR (Ajax).

However, as long as you implement the facets of a loadable, you can create your own.

Hierarchy

Implemented by

Index

Properties

oncomplete

oncomplete: function

oncomplete handler

Type declaration

    • (): void
    • Returns void

onerror

onerror: function

onerror handler

Type declaration

    • (e: any): void
    • Parameters

      • e: any

      Returns void

onprogress

onprogress: function

onprogress handler

Type declaration

    • (e: any): void
    • Parameters

      • e: any

      Returns void

Methods

getData

  • getData(): any

isLoaded

  • isLoaded(): boolean

load

processData

  • processData(data: any): any
  • Processes the downloaded data. Meant to be overridden.

    Parameters

    • data: any

    Returns any

setData

  • setData(data: any): void
  • Sets the data (can be populated from remote request or in-memory data)

    Parameters

    • data: any

    Returns void

wireEngine

  • wireEngine(engine: Engine): void