Reference pwinMouseX

pwinMouseX

A Number variable that tracks the mouse's previous horizontal position within the browser.

pwinMouseX keeps track of the mouse's position relative to the top-left corner of the browser window. Its value is winMouseX from the previous frame. For example, if the mouse was 50 pixels from the left edge of the browser during the last frame, then pwinMouseX will be 50.

On a touchscreen device, pwinMouseX will hold the x-coordinate of the most recent touch point. pwinMouseX is reset to the current winMouseX value at the start of each touch event.

Note: Use pmouseX to track the mouse’s previous x-coordinate within the canvas.

Examples

Notice any errors or typos? Please let us know. Please feel free to edit src/events/mouse.js and open a pull request!

Related References