Skip to main content

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

ParameterTypeDescription
widthnumberThe texture width
heightnumberThe texture height
formatTextureFormatThe 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

ParameterTypeDescription
widthnumberThe texture width
heightnumberThe texture height
formatTextureFormatThe texture format
materialHandlenumberThe material handle to attach to
propertyNamestringThe 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

ParameterTypeDescription
widthnumberThe texture width
heightnumberThe texture height
depthnumberThe texture depth
formatTextureFormatThe texture format

Returns

number

The texture handle


Destroy()

static Destroy(handle): boolean;

Defined in: render/texture.ts:134

Destroy a texture

Parameters

ParameterTypeDescription
handlenumberThe 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

ParameterTypeDescription
handlenumberThe texture handle
base64ImageArrayBufferLike-

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

ParameterTypeDescription
handlenumberThe texture handle
base64RgbaArrayBufferLike-
widthnumberThe texture width
heightnumberThe 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

ParameterTypeDescription
handlenumberThe texture handle
modeTextureFilterModeThe 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

ParameterTypeDescription
handlenumberThe texture handle
wrapModeTextureWrapModeThe wrap mode

Returns

boolean

boolean indicating success