CANVAS:set_pixel
CANVAS:set_pixel(x, y, color)
Set the pixel value at x, y to the specified color. This is equivalent to drawing a 1x1 filled rectangle.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | #number | The x position pixel. |
y | #number | The y position pixel. |
color | #number | An RGB color value as an integer value. |
Example
-- Place a red dot on the canvas
function RedDot(name)
local canvas = gre.get_canvas(name)
local size = canvas:get_dimensions()
local x = size.width / 2
local y = size.height / 2
canvas:set_pixel(x, y, 0xff2244)
end