Skip to main content

Texture

ClassTypeNameInterface Description
DataTypeEnum

UBNorm

F16

F32

• Represents an 8-Bit unsigned normalized integer data type.

• Represents a 16-bit floating-point data type.

• Represents a 32-bit floating-point data type.

FilterMipmap_ModeEnum

None

Nearest

Linearest

• Do not use Mipmap.

• Use the nearest neighbor sampling method.

• Use the linear sampling method.

FilterModeEnum

Nears

Linear

• Use the nearest neighbor sampling method.

• Use the linear sampling method.

InternalFormatEnum

RGB8U

RGBA8U

RGB16F

RGBA16F

RGB32F

RGBA32F

• Represents 8-bit unsigned integer in RGB format.

• Represents an 8-bit unsigned integer in RGBA format.

• Represents a 16-bit floating-point number in RGB format.

• Represents a 16-bit floating-point number in RGBA format.

• Represents a 32-bit floating-point number in RGB format.

• Represents a 32-bit floating-point number in RGBA format.

PixelFormatEnum

RGB8Unorm

RGB16SFloat

RGBA16SFloat

RGBA32SFloat

RGBA32SFloat

• Represents 8-bit unsigned normalized integer in RGB format.

• Represents an 8-bit unsigned normalized integer in RGBA format.

• Represents a 16-bit floating-point number in RGB format.

• Represents a 16-bit floating-point number in RGBA format.

• Represents a 32-bit floating-point number in RGB format.

• Represents a 32-bit floating-point number in RGBA format.

WrapModeEnum

Repeat

Clamp

Mirror

• Texture repeat mode.

• Texture clamping mode.

• Texture mirroring mode.

ClassTypeNameInterface Description
TextureVariablesenableMipmap: boolean

Function: Indicates whether Mipmap is enabled.

TextureVariablesfilterMin: FilterMode

Function: The minimum filtering mode of the texture.

TextureVariablesfilterMag: FilterMode

Function: The maximum filtering mode of the texture.

TextureVariablesfilterMipmap: FilterMipmapMode

Function: The Mipmap filtering mode of the texture.

TextureVariableswrapMode: WrapMode

Function: The wrapping mode of the texture.

TextureVariableswrapModeS: WrapMode

Function: The wrapping mode of the texture in the S direction.

TextureVariableswrapModeT: WrapMode

Function: The wrapping mode of the texture in the T direction.

TextureVariableswrapModeR: WrapMode

Function: The wrapping mode of the texture in the R direction.

TextureVariablesmaxAnisotropy: number

Function: The maximum anisotropic filtering value of the texture.

Examples

enableMipmap: boolean

tex.enableMipmap = true

filterMin: FilterMode

tex.filterMin = APJS.FilterMode.Nears

filterMag: FilterMode

tex.filterMax = APJS.FilterMode.Nears

filterMipmap: FilterMipmapMode

tex.filterMipmap = APJS.FilterMipmapMode.None

wrapMode: WrapMode

tex.wrapMode = APJS.WrapMode.Repeat

wrapModeS: WrapMode

tex.wrapModeS = APJS.WrapMode.Repea

wrapModeT: WrapMode

tex.wrapModeT = APJS.WrapMode.Repeat

wrapModeR: WrapMode

tex.wrapModeR = APJS.WrapMode.Repeat

maxAnisotropy: number

tex.maxAnisotropy = 1

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
private tex:Texture; // get texture in some way
onStart() {
const result = `enableMipmap: ${this.tex.enableMipmap}
filterMin: ${this.tex.filterMin}
filterMag: ${this.tex.filterMag}
filterMipmap: ${this.tex.filterMipmap}
wrapModeR: ${this.tex.wrapModeR}
wrapModeT: ${this.tex.wrapModeT}
wrapModeS: ${this.tex.wrapModeS}
maxAnisotropy: ${this.tex.maxAnisotropy}`

}
onUpdate(deltaTime: number) {
}
}
ClassTypeNameInterface Description
TextureFunctionsgetWidth(): number

Function: Get the width of the texture.

TextureFunctionsgetHeight(): number

Function: Get the height of the texture.

TextureFunctionsgetDepth(): number

Function: Get the depth of the texture.

Examples

getWidth(): number

let texture = new Texture();
let width = texture.getWidth();

getHeight(): number

let texture = new Texture();
let height = texture.getHeight();

getDepth(): number

let texture = new Texture();
let depth = texture.getDepth();

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
private tex:Texture; // get texture in some way
onStart() {
const result = `${this.tex.getWidth()}x${this.tex.getHeight()}
Depth: ${this.tex.getDepth()}`;

}
onUpdate(deltaTime: number) {
}
}
Copyright © 2025 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalCookies