LuaTexture

PropertyTypeWritableDescription
Width
number
Read-only
Width of the texture.
Height
number
Read-only
Height of the texture.
Function
SetPixel(x: number, y: number, color: Color)
SetPixel(x: number, y: number, color: { r: number | nil; g: number | nil; b: number | nil; a: number | nil })
SetPixel(x: number, y: number, color: { red: number | nil; green: number | nil; blue: number | nil; alpha: number | nil })
SetPixel(x: number, y: number, hexColor: string)
Sets the color of a pixel at the specified coordinates.
GetPixel(x: number, y: number): red
Returns the color of a pixel at the specified coordinates. Returns RGBA values as separate numbers.
Fill(color: Color)
Fill(color: { r: number | nil; g: number | nil; b: number | nil; a: number | nil })
Fill(color: { red: number | nil; green: number | nil; blue: number | nil; alpha: number | nil })
Fill(hexColor: string)
Fills the entire texture with the specified color.
CopyFrom(sourceTexture: LuaTexture, srcX: number, srcY: number, srcWidth: number, srcHeight: number, dstX: number, dstY: number)
Copies pixels from another texture to this texture.
Update()
Updates the GPU texture with the current pixmap data. Call this after making pixel modifications to see changes.
Dispose()
Disposes the texture and pixmap, freeing GPU and system memory. The texture becomes unusable after calling this.