
A loadable asset base class. All asset types inherit from this.
Kind: global class
BooleanStringBooleanPromisePromisePromiseCreate the new asset.
| Param | Type | Description |
|---|---|---|
| url | String |
Asset URL / identifier. |
BooleanGet if this asset is ready, ie loaded or created.
Kind: instance property of Asset
Returns: Boolean - True if asset finished loading / creating. This doesn’t mean its necessarily valid, only that its done loading.
StringGet asset’s URL.
Kind: instance property of Asset
Returns: String - Asset URL.
BooleanGet if this asset is loaded and valid.
Kind: instance property of Asset
Returns: Boolean - True if asset is loaded and valid, false otherwise.
Register a method to be called when asset is ready. If asset is already in ready state, will invoke immediately.
Kind: instance method of Asset
| Param | Type | Description |
|---|---|---|
| callback | function |
Callback to invoke when asset is ready. |
PromiseReturn a promise to resolve when ready.
Kind: instance method of Asset
Returns: Promise - Promise to resolve when ready.
PromiseLoad the asset from it’s URL.
Kind: instance method of Asset
Returns: Promise - Promise to resolve when fully loaded.
| Param | Type | Description |
|---|---|---|
| params | \* |
Optional additional params. |
PromiseCreate the asset from data source.
Kind: instance method of Asset
Returns: Promise - Promise to resolve when asset is ready.
| Param | Type | Description |
|---|---|---|
| source | \* |
Data to create asset from. |
| params | \* |
Optional additional params. |
Destroy the asset, freeing any allocated resources in the process.
Kind: instance method of Asset