frame_count#

The system variable frame_count contains the number of frames that have been displayed since the program started.

Examples#

1def setup():
2    py5.frame_rate(30)
3
4
5def draw():
6    py5.line(0, 0, py5.width, py5.height)
7    py5.println(py5.frame_count)

Description#

The system variable frame_count contains the number of frames that have been displayed since the program started. Inside setup() the value is 0. Inside the first execution of draw() it is 1, and it will increase by 1 for every execution of draw() after that.

Underlying Processing field: frameCount

Updated on November 12, 2021 11:30:58am UTC