AssetLoader

An AssetLoader is used to load and parse an Asset from a given URL. They are associated with an asset type and file extensions, which the AssetManager uses to find the loader for a requested Asset.

Constructor

new L3D.AssetLoader(assetType, extensions)

Parameters
assetType String

The type of asset loaded by this loader.

extensions String | Array

The file extensions associated with this loader.

Methods

load(url) → nullable Asset

Load an asset from the given URL. If the load is asynchronous, such as from a remote URL, then the asset is returned with its state set to Loading, and when the asynchronous load finishes, it is set to Loaded. The users of the asset will asset will look at its state to see if it's ready to be used. Note that the state of assets is Unloaded by default, so the state should always be set by the AssetLoader loader.

Parameters
url String

The url of the asset.

Returns
Asset

The loaded asset.