The width variable in p5.js is a system variable that stores the width of the drawing canvas. This value is automatically initialised by the first parameter of the createCanvas() function as soon as the code is executed.
Parameters: This function does not accept any parameter.
Below program illustrates the width variable in p5.js:
- HTML width/height Attribute vs CSS width/height Property
- How to set div width to fit content using CSS ?
- CSS | Height and Width
- jQuery | width()
- CSS | min-width Property
- CSS | max-width Property
- HTML | DOM HR width Property
- How to get the width and height of an image ?
- CSS | stroke-width Property
- CSS | border-right-width Property
- HTML | <col> width Attribute
- CSS | border-top-width Property
- HTML | <th> width Attribute
- CSS | scrollbar-width Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.