API Reference

Class List

pc.ResourceHandler

Summary

Methods

[patch]Optional function to perform any operations on a resource, that requires a dependency on its asset data or any other asset data.
loadLoad a resource from a remote URL.
openConvert raw resource data into a resource instance.

Details

Constructor

ResourceHandler()

Interface for ResourceHandlers used by pc.ResourceLoader.

Methods

[patch](asset, assets)

Optional function to perform any operations on a resource, that requires a dependency on its asset data or any other asset data.

Parameters

assetpc.AssetThe asset to patch.
assetspc.AssetRegistryThe asset registry.

load(url, callback, [asset])

Load a resource from a remote URL. When loaded (or failed), use the callback to return an the raw resource data (or error).

Parameters

urlStringThe URL of the resource to load.
callbackpc.callbacks.ResourceHandlerThe callback used when the resource is loaded or an error occurs.
assetpc.AssetOptional asset that is passed by ResourceLoader.

open(url, data, [asset])

Convert raw resource data into a resource instance. e.g. take 3D model format JSON and return a pc.Model.

Parameters

urlStringThe URL of the resource to open.
data*The raw resource data passed by callback from pc.ResourceHandler#load.
assetpc.AssetOptional asset that is passed by ResourceLoader.

Returns

* The parsed resource data.