p5.js | Mouse | mouseY
The mouseY variable in p5.js is used to store the current vertical position of the mouse, relative to (0, 0) of the canvas. If touch is used instead of mouse input, mouseX will hold the y value of the most recent touch point.
Below programs illustrate the mouseY variable in p5.js:
Example 1: This example uses mouseY variable to display vertical position ofmouse.
Example 2: This example uses mouseY variable to display vertical position ofmouse.