Static
defaultThe default stroke of the sketch. Equivalent to a stroke of 1 in a 500x500 sketch.
Static
isIs the canvas rendering mode set to WebGL?
Static
lockedWhen true, buildCanvas will not create a new canvas.
Static
buildBuild a p5 canvas with the given aspect ratio, resolution, and canvas type.
If lockedCanvas is true
, no canvas will be built.
Optional
canvasType: stringCan be WEBGL ("webgl") or P2D ("p2d").
Optional
lockCanvas: booleanWhen true
, the canvas will be locked after it has been created.
Static
lockLocks the canvas. After this is called, buildCanvas will not create a new canvas.
Static
resizeStatic
unlockUnlocks the canvas. After this is called, buildCanvas will create a new canvas.
Static
updateUpdate the current aspect ratio of the canvas to the given aspect ratio. This method will resize the canvas and decorate it with the appropriate updated attributes.
Static
update
The CanvasContext provides static access to information and methods for the running p5.js sketch canvas.