canvas.setPixel
canvas.setPixel(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) {
var canvas = sb.getCanvas(name);
var x = canvas.width / 2;
var y = canvas.height / 2;
canvas.setPixel(x, y, 0xff2244);
}