width
A Number variable that stores the width of the canvas in pixels.
width's default value is 100. Calling size() or
resizeWindow() changes the value of
width.
Examples

function setup()
size(100, 100)
background(200)
-- Display the canvas' width.
text(width, 42, 54)
describe('The number 100 written on a gray square.')
end
Syntax
width
Related
This reference page contains content adapted from p5.js and Processing by p5.js Contributors and Processing Foundation, licensed under CC BY-NC-SA 4.0.