Texture

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

Texture.getName

Returns this texture name
overload 1:
Texture:getName()
Method Property Fluent Description Representation
Return Value a String

Texture.update

Updates the texture to the GPU, applying all the changes
overload 1:
Texture:update()
Method Property Fluent Description Representation
Return Value nil

Texture.fill

Sets the RGBA color of the entire specified region
overload 1:
Texture:fill(x, y, width, height, rgb)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
width accepts an Integer
height accepts an Integer
rgb accepts a Vector3
Return Value nil
overload 2:
Texture:fill(x, y, width, height, rgba)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
width accepts an Integer
height accepts an Integer
rgba accepts a Vector4
Return Value nil
overload 3:
Texture:fill(x, y, width, height, r, g, b, a)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
width accepts an Integer
height accepts an Integer
r accepts a Number
g accepts a Number
b accepts a Number
a accepts a Number
Return Value nil

Texture.save

Returns a base64 string representation of this texture
overload 1:
Texture:save()
Method Property Fluent Description Representation
Return Value a String

Texture.getDimensions

Returns a vector of this texture width and height
overload 1:
Texture:getDimensions()
Method Property Fluent Description Representation
Return Value a Vector2

Texture.restore

Restores the texture to its original state, before any modifications
overload 1:
Texture:restore()
Method Property Fluent Description Representation
Return Value nil

Texture.getPixel

Gets the RGBA color from the specified pixel
overload 1:
Texture:getPixel(x, y)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
Return Value a Vector4

Texture.setPixel

Sets the RGBA color of the specified pixel
overload 1:
Texture:setPixel(x, y, rgb)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
rgb accepts a Vector3
Return Value nil
overload 2:
Texture:setPixel(x, y, rgba)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
rgba accepts a Vector4
Return Value nil
overload 3:
Texture:setPixel(x, y, r, g, b, a)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
r accepts a Number
g accepts a Number
b accepts a Number
a accepts a Number
Return Value nil

Texture.applyFunc

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, y, width, height, func)
Method Property Fluent Description Representation
x accepts an Integer
y accepts an Integer
width accepts an Integer
height accepts an Integer
func accepts a function that takes a Vector4, a Number and a Number and will return either a Vector4 or nil
Return Value nil
a a