Environment

These variables keep track of attributes of the p5 environment

frameCount

This 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

This variable stores the width of the canvas in pixels, not to be confused with the width of the window, windowWidth

height

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

windowWidth

This 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

This 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.

Find these documents helpful? Let the people who made them help your child learn to code at Strivemath!

We'd love to hear your Feedback/Comments here.

Last updated