frame_count

frame_count

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

Examples

1
2
3
4
5
6
7
def setup():
    py5.frame_rate(30)


def draw():
    py5.line(0, 0, py5.width, py5.height)
    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