Environment
These variables keep track of attributes of the p5 environment
frameCount
frameCountThis variable stores how many frames have been drawn since the sketch (most recently) started.

For example - if the frame rate is set to 60 (which is the default) - after 3 seconds, frameCount = 180 because this is how many frames have been drawn during that time.
width
widthThis variable stores the width of the canvas in pixels, not to be confused with the width of the window, windowWidth

height
heightThis variable stores the height of the canvas in pixels, not to be confused with the height of the window, windowHeight

windowWidth
windowWidthThis variable stores the width of the window, not to be confused with the width of the canvas width.
This variable changes as the window size changes.

windowHeight
windowHeightThis variable stores the height of the window, not to be confused with the height of the canvas height.
This variable changes as the window size changes.

Last updated