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 Java field: frameCount

Updated on September 11, 2021 16:51:34pm UTC