API Reference

Class List

pc.TextureParser

Summary

Methods

load

Load the texture from the remote URL.

open

Convert raw resource data into a resource instance.

Details

Constructor

TextureParser()

Interface to a texture parser. Implementations of this interface handle the loading and opening of texture assets.

Methods

load(url, callback, [asset])

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

Parameters

urlobject

The URL of the resource to load.

url.loadstring

The URL to use for loading the resource

url.originalstring

The original URL useful for identifying the resource type

callbackpc.callbacks.ResourceHandler

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

assetpc.Asset

Optional asset that is passed by ResourceLoader.

open(url, data, asset, device)

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

Parameters

urlstring

The URL of the resource to open.

data*

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

assetpc.Asset, null

Optional asset which is passed in by ResourceLoader.

devicepc.GraphicsDevice

The graphics device

Returns

pc.Texture

The parsed resource data.