p5.js | Mouse | pmouseX
The pmouseX variable in p5.js is used to store the horizontal position of the mouse cursor in the frame previous to the currently active frame, relative to the origin of the canvas.
Below programs illustrate the pmouseX variable in p5.js:
Example 1: This example uses pmouseX variable to draw mouse pointer as circle.
Example 2: This example uses pmouseX variable to display the position of mouse pointer.