A Number
system variable that tracks the mouse's previous vertical position.
In 2D mode, pmouseY
keeps track of the mouse's position relative to the top-left corner of the canvas. Its value is mouseY from the previous frame. For example, if the mouse was 50 pixels from the top edge of the canvas during the last frame, then pmouseY
will be 50.
In WebGL mode, pmouseY
keeps track of the mouse's position relative to the center of the canvas. For example, if the mouse was 50 pixels below the canvas' center during the last frame, then pmouseY
will be 50.
If touch is used instead of the mouse, then pmouseY
will hold the y-coordinate of the last touch point.
Note: pmouseY
is reset to the current mouseY value at the start of each touch event.
Examples
Related References
doubleClicked
A function that's called once when a mouse button is clicked twice quickly.
exitPointerLock
Exits a pointer lock started with requestPointerLock.
mouseButton
A String system variable that contains the value of the last mouse button pressed.
mouseClicked
A function that's called once after a mouse button is pressed and released.