p5.js noCursor() function
Last Updated :
10 Aug, 2023
Improve
The noCursor() function in p5.js is used to hide the cursor from view.
Syntax
javascript
Output:
Example-2:
javascript
Output:
Reference: https://p5js.org/reference/#/p5/noCursor
noCursor()Parameters: This function does not accept any parameter. Below program illustrates the noCursor() function in p5.js: Example-1:
function setup() {
createCanvas(1000, 400);
// Set text size to 40px
textSize(20);
// Call to noCursor() function
noCursor();
}
function draw() {
background(200);
rect(mouseX, mouseY, 30, 30);
text("Position of mouse is "
+mouseX+", "+mouseY, 30, 40);
}

function setup() {
createCanvas(1000, 400);
// Set text size to 40px
textSize(20);
// Call to noCursor() function
noCursor();
}
function draw() {
background(200);
circle(mouseX, mouseY, 10);
text("Position of mouse is "
+mouseX+", "+mouseY, 30, 40);
}
