Base class for ResourceHandlers used by ResourceLoader.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

_app: AppBase

The running app instance.

_maxRetries: number = 0
handlerType: string = ''

Type of the resource the handler handles.

Accessors

Methods

  • Load a resource from a remote URL. The base implementation does nothing.

    Parameters

    • url: string | object

      Either the URL of the resource to load or a structure containing the load and original URL.

    • callback: ResourceHandlerCallback

      The callback used when the resource is loaded or an error occurs.

    • Optional asset: Asset

      Optional asset that is passed by ResourceLoader.

    Returns void

  • The open function is passed the raw resource data. The handler can then process the data into a format that can be used at runtime. The base implementation simply returns the data.

    Parameters

    • url: string

      The URL of the resource to open.

    • data: any

      The raw resource data passed by callback from ResourceHandler#load.

    • Optional asset: Asset

      Optional asset that is passed by ResourceLoader.

    Returns any

    The parsed resource data.

  • The patch function performs any operations on a resource that requires a dependency on its asset data or any other asset data. The base implementation does nothing.

    Parameters

    Returns void