LensStudio:AssetUtils.js.importImageAsTexture
FunctionImports an image as a texture and sets up its wrap mode.
importImageAsTexture(
assetManager,imageFileAbsolutePath,wrapMode?,imageImportDestinationDir?):Promise<{imageAsset:Asset;textureParam:TextureParameter; }>
Imports an image as a texture and sets up its wrap mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
assetManager | AssetManager | - |
imageFileAbsolutePath | string | The absolute path to the image file. |
wrapMode? | WrapMode | The wrap mode for the texture. Defaults to Editor.Assets.WrapMode.ClampToEdge. |
imageImportDestinationDir? | string | The directory where the image will be imported. Defaults to "Images". |
Returns
Promise<{ imageAsset: Asset; textureParam: TextureParameter; }>
An object containing the image asset and texture parameter.
Throws
Will log an error if the image asset fails to load.