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
2
3
4
5
6
# move the mouse quickly to see the difference
# between the current and previous position
def draw():
    py5.background(204)
    py5.line(20, py5.mouse_y, 80, py5.pmouse_y)
    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 Java field: pmouseY

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