TextureResource

constructor(path: String, loadType: LoadType = LoadType.FROM_ASSETS, option: TextureCreateOption = TextureCreateOption())

Construct TextureResource by specifying path.

Parameters

path

The given path.

loadType

The different ways of loading type, default is FROM_ASSETS.

option

The texture resource creating option.


constructor(path: String, loadType: LoadType = LoadType.FROM_ASSETS)

Construct TextureResource by specifying path.

Parameters

path

The given path.

loadType

The different ways of loading type, default is FROM_ASSETS.

Throws

If an error occurs during the loading process.


constructor(bitmap: Bitmap)

Asynchronously create texture resource from bitmap.

Only a part of format is supported now:

  • Bitmap.Config.ARGB_8888

  • Bitmap.Config.RGBA_F16

If a Bitmap with unsupported format is given, an IllegalArgumentException will be thrown.

Note that, you shouldn't modify this bitmap during creating texture resource.

Return

The TextureResource which load.

Parameters

bitmap

The given bitmap.

Throws

If an error occurs during the loading process.

IllegalArgumentException

If the bitmap has an unsupported format.