A source of assets that can be registered with the engine. Allows custom asset sources with callbacks for querying and applying assets.
Methods#
findAssets()#
findAssets(queryData): Promise<AssetsQueryResult<AssetResult>>;Find assets matching the query. This is the only required callback.
Parameters#
| Parameter | Type |
|---|---|
queryData |
AssetQueryData |
Returns#
Promise<AssetsQueryResult<AssetResult>>
Properties#
| Property | Type | Description |
|---|---|---|
id |
string |
The unique id of this asset source |
fetchAsset? |
(id, params?) => Promise<AssetResult> |
Fetch a single asset by id |
getGroups? |
() => Promise<string[]> |
Return available groups |
credits? |
object |
Credits for this source |
credits.name |
string |
- |
credits.url? |
string |
- |
license? |
object |
General license for assets from this source |
license.name |
string |
- |
license.url? |
string |
- |
canManageAssets? |
boolean |
Deprecated Will be removed in v1.11 |
applyAsset? |
(asset) => Promise<number> |
Apply an asset to the active scene |
applyAssetToBlock? |
(asset, block) => Promise<void> |
Apply an asset to a specific block |
applyAssetProperty? |
(asset, property) => Promise<void> |
Apply a property of an asset |
addAsset? |
(asset) => void |
Add an asset to this source |
removeAsset? |
(assetId) => void |
Remove an asset from this source |
getSupportedMimeTypes? |
() => string[] |
Get supported MIME types |