Buy Me a Coffee at ko-fi.com

A texture object, either generated by the model or created with the TextureAPI

Calls the given function on the specified area of this texture, it will iterate over each pixel, giving its current x, y, and color as arguments, the color is a vec4 in RGBA format, and the return value will set that pixel's color
Invalid return values or nil takes no effects

overload 1:
Texture.applyFunc(x: Integer, y: Integer, width: Integer, height: Integer, func: (Vector4, Number, Number) -> Vector4 | nil): Texture
typings.-672261858typings.-672261858typings.-672261858typings.-672261858typings.2067910057typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
width accepts
height accepts
func accepts
Return Value

Transforms all pixels in the specified area of this texture by the matrix
If `clip` is true, the resulting colour channels will be clamped between 0 and 1

overload 1:
Texture.applyMatrix(x: Integer, y: Integer, width: Integer, height: Integer, matrix: Matrix4, clip: Boolean): Texture
typings.-672261858typings.-672261858typings.-672261858typings.-672261858typings.-1789003661typings.1729365000typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
width accepts
height accepts
matrix accepts
clip accepts
Return Value

Sets the RGBA color of the entire specified region

overload 1:
Texture.fill(x: Integer, y: Integer, width: Integer, height: Integer, rgb: Vector3): Texture
typings.-672261858typings.-672261858typings.-672261858typings.-672261858typings.2002444080typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
width accepts
height accepts
rgb accepts
Return Value
overload 2:
Texture.fill(x: Integer, y: Integer, width: Integer, height: Integer, rgba: Vector4): Texture
typings.-672261858typings.-672261858typings.-672261858typings.-672261858typings.2002444081typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
width accepts
height accepts
rgba accepts
Return Value
overload 3:
Texture.fill(x: Integer, y: Integer, width: Integer, height: Integer, r: Number, g: Number, b: Number, a: Number): Texture
typings.-672261858typings.-672261858typings.-672261858typings.-672261858typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
width accepts
height accepts
r accepts
g accepts
b accepts
a accepts
Return Value

Returns a vector of this texture width and height

overload 1:
Texture.getDimensions(): Vector2
typings.2002444079
Method PropertyFluent DescriptionRepresentation
Return Value

Returns this texture name

overload 1:
Texture.getName(): String
typings.-1808118735
Method PropertyFluent DescriptionRepresentation
Return Value

Returns this texture resource path location

overload 1:
Texture.getPath(): String
typings.-1808118735
Method PropertyFluent DescriptionRepresentation
Return Value

Gets the RGBA color from the specified pixel

overload 1:
Texture.getPixel(x: Integer, y: Integer): Vector4
typings.-672261858typings.-672261858typings.2002444081
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
Return Value

Sets the RGBA color of the specified pixel

overload 1:
Texture.pixel(x: Integer, y: Integer, rgb: Vector3): Texture
typings.-672261858typings.-672261858typings.2002444080typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
rgb accepts
Return Value
overload 2:
Texture.pixel(x: Integer, y: Integer, rgba: Vector4): Texture
typings.-672261858typings.-672261858typings.2002444081typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
rgba accepts
Return Value
overload 3:
Texture.pixel(x: Integer, y: Integer, r: Number, g: Number, b: Number, a: Number): Texture
typings.-672261858typings.-672261858typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
r accepts
g accepts
b accepts
a accepts
Return Value

Restores the texture to its original state, before any modifications

overload 1:
Texture.restore(): Texture
typings.246836475
Method PropertyFluent DescriptionRepresentation
Return Value

Returns a base64 string representation of this texture

overload 1:
Texture.save(): String
typings.-1808118735
Method PropertyFluent DescriptionRepresentation
Return Value

Sets the RGBA color of the specified pixel

overload 1:
Texture.setPixel(x: Integer, y: Integer, rgb: Vector3): Texture
typings.-672261858typings.-672261858typings.2002444080typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
rgb accepts
Return Value
overload 2:
Texture.setPixel(x: Integer, y: Integer, rgba: Vector4): Texture
typings.-672261858typings.-672261858typings.2002444081typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
rgba accepts
Return Value
overload 3:
Texture.setPixel(x: Integer, y: Integer, r: Number, g: Number, b: Number, a: Number): Texture
typings.-672261858typings.-672261858typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.246836475
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
r accepts
g accepts
b accepts
a accepts
Return Value

Updates the texture to the GPU, applying all the changes

overload 1:
Texture.update(): Texture
typings.246836475
Method PropertyFluent DescriptionRepresentation
Return Value