pmouse_y#

The system variable pmouse_y always contains the vertical position of the mouse in the frame previous to the current frame.

Examples#

1# move the mouse quickly to see the difference
2# between the current and previous position
3def draw():
4    py5.background(204)
5    py5.line(20, py5.mouse_y, 80, py5.pmouse_y)
6    py5.println(py5.mouse_y, ":", py5.pmouse_y)

Description#

The system variable pmouse_y always contains the vertical position of the mouse in the frame previous to the current frame.

For more detail on how pmouse_y is updated inside of mouse events and draw(), see the reference for pmouse_x.

Underlying Processing field: pmouseY

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