-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
The documentation for mouseX states:
In WebGL mode, mouseX keeps track of the mouse's position relative to the center of the canvas. For example, if the mouse is 50 pixels to the right of the canvas' center, then mouseX will be 50.
I take this to also mean if the cursor is at the center of the canvas, mouseX/mouseY will be 0,0.
However, this does not appear to be true in p5.js with WEBGL mode, as can be seen in the last example on the docs page: when placing the cursor at the center of the canvas, mouse position is 50, 50. If the mouse is 50 pixels to the right of the canvas' center, then mouseX is 100.
I'm not sure if this is a mistake in the docs or a bug in p5.js