load

@JvmStatic
fun load(path: String, loadType: LoadType = LoadType.FROM_ASSETS, option: TextureCreateOption = TextureCreateOption()): TextureResource

Loads a TextureResource from a file path.

Note: For complex or high-resolution resources that require significant processing time, it is strongly recommended to leverage coroutines for loading. This approach prevents blocking the main thread, ensuring a responsive and fluid user experience.

Return

The loaded TextureResource.

Parameters

path

The file path of the texture.

loadType

The loading method; defaults to FROM_ASSETS.

option

Options for creating the texture resource.

Throws

If an error occurs during the loading process.


@JvmStatic
fun load(path: String, loadType: LoadType = LoadType.FROM_ASSETS): TextureResource

Loads a TextureResource from a file path.

Return

The loaded TextureResource.

Parameters

path

The file path of the texture.

loadType

The loading method; defaults to FROM_ASSETS.

Throws

If an error occurs during the loading process.

Note: For complex or high-resolution resources that require significant processing time, it is strongly recommended to leverage coroutines for loading. This approach prevents blocking the main thread, ensuring a responsive and fluid user experience.