Class: TextureManager
Defined in: render/texture.ts:49
Constructors
Constructor
new TextureManager(): TextureManager;
Returns
TextureManager
Methods
Create2D()
static Create2D(
width,
height,
format): number;
Defined in: render/texture.ts:57
Create a 2D texture
Parameters
| Parameter | Type | Description |
|---|---|---|
width | number | The texture width |
height | number | The texture height |
format | TextureFormat | The texture format |
Returns
number
The texture handle
Create2DForMaterial()
static Create2DForMaterial(
width,
height,
format,
materialHandle,
propertyName): number;
Defined in: render/texture.ts:81
Create a 2D texture and attach it to a material
Parameters
| Parameter | Type | Description |
|---|---|---|
width | number | The texture width |
height | number | The texture height |
format | TextureFormat | The texture format |
materialHandle | number | The material handle to attach to |
propertyName | string | The material property name |
Returns
number
The texture handle
CreateRenderTexture()
static CreateRenderTexture(
width,
height,
depth,
format): number;
Defined in: render/texture.ts:112
Create a render texture
Parameters
| Parameter | Type | Description |
|---|---|---|
width | number | The texture width |
height | number | The texture height |
depth | number | The texture depth |
format | TextureFormat | The texture format |
Returns
number
The texture handle
Destroy()
static Destroy(handle): boolean;
Defined in: render/texture.ts:134
Destroy a texture
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The texture handle to destroy |
Returns
boolean
boolean indicating success
LoadImage()
static LoadImage(handle, base64Image): boolean;
Defined in: render/texture.ts:171
Loads PNG/JPG image byte array into a texture.
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The texture handle |
base64Image | ArrayBufferLike | - |
Returns
boolean
boolean indicating success
LoadRawTextureData()
static LoadRawTextureData(
handle,
base64Rgba,
width,
height): boolean;
Defined in: render/texture.ts:148
Set raw RGBA iamge for the texture
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The texture handle |
base64Rgba | ArrayBufferLike | - |
width | number | The texture width |
height | number | The texture height |
Returns
boolean
boolean indicating success
SetFilterMode()
static SetFilterMode(handle, mode): boolean;
Defined in: render/texture.ts:191
Set the filter mode for the texture
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The texture handle |
mode | TextureFilterMode | The filter mode |
Returns
boolean
boolean indicating success
SetWrapMode()
static SetWrapMode(handle, wrapMode): boolean;
Defined in: render/texture.ts:209
Set the wrap mode for the texture
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The texture handle |
wrapMode | TextureWrapMode | The wrap mode |
Returns
boolean
boolean indicating success