Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 10 additions & 26 deletions src/events/pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,10 @@ function pointer(p5, fn){
/**
* A `Number` system variable that tracks the mouse's horizontal position.
*
* In 2D mode, `mouseX` keeps track of the mouse's position relative to the
* `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.
*
* 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.
*
* If touch is used instead of the mouse, then `mouseX` will hold the
* x-coordinate of the most recent touch point.
*
Expand Down Expand Up @@ -157,7 +153,7 @@ function pointer(p5, fn){
* textSize(16);
*
* // Display the mouse's coordinates.
* text(`x: ${mouseX} y: ${mouseY}`, 50, 50);
* text(`x: ${int(mouseX)} y: ${int(mouseY)}`, 50, 50);
* }
* </code>
* </div>
Expand Down Expand Up @@ -208,7 +204,7 @@ function pointer(p5, fn){
* fill(0);
*
* // Display the mouse's coordinates.
* text(`x: ${mouseX} y: ${mouseY}`, 0, 0);
* text(`x: ${int(mouseX)} y: ${int(mouseY)}`, 0, 0);
* }
* </code>
* </div>
Expand All @@ -218,14 +214,10 @@ function pointer(p5, fn){
/**
* A `Number` system variable that tracks the mouse's vertical position.
*
* In 2D mode, `mouseY` keeps track of the mouse's position relative to the
* `mouseY` 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 top edge of the canvas, then `mouseY` will be 50.
*
* In WebGL mode, `mouseY` keeps track of the mouse's position relative to the
* center of the canvas. For example, if the mouse is 50 pixels below the
* canvas' center, then `mouseY` will be 50.
*
* If touch is used instead of the mouse, then `mouseY` will hold the
* y-coordinate of the most recent touch point.
*
Expand Down Expand Up @@ -266,7 +258,7 @@ function pointer(p5, fn){
* textSize(16);
*
* // Display the mouse's coordinates.
* text(`x: ${mouseX} y: ${mouseY}`, 50, 50);
* text(`x: ${int(mouseX)} y: ${int(mouseY)}`, 50, 50);
* }
* </code>
* </div>
Expand Down Expand Up @@ -317,7 +309,7 @@ function pointer(p5, fn){
* fill(0);
*
* // Display the mouse's coordinates.
* text(`x: ${mouseX} y: ${mouseY}`, 0, 0);
* text(`x: ${int(mouseX)} y: ${int(mouseY)}`, 0, 0);
* }
* </code>
* </div>
Expand All @@ -328,16 +320,12 @@ function pointer(p5, fn){
* A `Number` system variable that tracks the mouse's previous horizontal
* position.
*
* In 2D mode, `pmouseX` keeps track of the mouse's position relative to the
* `pmouseX` keeps track of the mouse's position relative to the
* top-left corner of the canvas. Its value is
* <a href="#/p5/mouseX">mouseX</a> from the previous frame. For example, if
* the mouse was 50 pixels from the left edge of the canvas during the last
* frame, then `pmouseX` will be 50.
*
* In WebGL mode, `pmouseX` keeps track of the mouse's position relative to the
* center of the canvas. For example, if the mouse was 50 pixels to the right
* of the canvas' center during the last frame, then `pmouseX` will be 50.
*
* If touch is used instead of the mouse, then `pmouseX` will hold the
* x-coordinate of the last touch point.
*
Expand Down Expand Up @@ -397,16 +385,12 @@ function pointer(p5, fn){
* 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
* `pmouseY` keeps track of the mouse's position relative to the
* top-left corner of the canvas. Its value is
* <a href="#/p5/mouseY">mouseY</a> 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.
*
Expand Down Expand Up @@ -496,7 +480,7 @@ function pointer(p5, fn){
* textSize(16);
*
* // Display the mouse's coordinates within the browser window.
* text(`x: ${winMouseX} y: ${winMouseY}`, 50, 50);
* text(`x: ${int(winMouseX)} y: ${int(winMouseY)}`, 50, 50);
* }
* </code>
* </div>
Expand Down Expand Up @@ -537,7 +521,7 @@ function pointer(p5, fn){
* textSize(16);
*
* // Display the mouse's coordinates within the browser window.
* text(`x: ${winMouseX} y: ${winMouseY}`, 50, 50);
* text(`x: ${int(winMouseX)} y: ${int(winMouseY)}`, 50, 50);
* }
* </code>
* </div>
Expand Down
Loading