Canvas
// "id" - the key associated with this canvas
// x - the width of the canvas, in pixels
// y - the height of the canvas, in pixels
// fill - the background color of the canvas (ex. #fff)
canv "create" "id" x y fill
// dataURI - the content of this canvas
// will be stretched to fit the width and height
canv "load" "id" dataURI x yWriting to the Canvas
// x and y are coordinates in pixels.
// (0, 0) of every canvas is in the center.
canv "set_pixel_xy" "id" x y color
// index writes to a pixel by the position it's stored internally.
// index flows from left to right, top to bottom.
canv "set_pixel" "id" index colorShapes
Stamping
Reading the Canvas
Managing Canvases
Deleting/Clearing Canvases
Resizing Canvases
Example: Drawing a Checker Pattern
Last updated