Reference mouseX

mouseX

A Number system variable that tracks the mouse's horizontal position.

mouseX keeps track of the mouse's position relative to the top-left corner of the canvas. For example, if the mouse is 50 pixels from the left edge of the canvas, then mouseX will be 50.

If touch is used instead of the mouse, then mouseX will hold the x-coordinate of the most recent touch point.

Examples

This page is generated from the comments in src/events/mouse.js . Please feel free to edit it and submit a pull request!

Related References