TextureData:getPixel
Returns the value of a pixel of the TextureData.
r, g, b, a = TextureData:getPixel(x, y)
Arguments
Name | Type | Description |
x | number | The x coordinate of the pixel to get (0-indexed). |
y | number | The y coordinate of the pixel to get (0-indexed). |
Returns
Name | Type | Description |
r | number | The red component of the pixel, from 0.0 to 1.0. |
g | number | The green component of the pixel, from 0.0 to 1.0. |
b | number | The blue component of the pixel, from 0.0 to 1.0. |
a | number | The alpha component of the pixel, from 0.0 to 1.0. |
Notes
The following texture formats are supported: rgba
, rgb
, r32f
, rg32f
, and rgba32f
.
See also
TextureData:setPixel
Texture:replacePixels
TextureFormat
TextureData:setPixel
TextureData