Open In App

p5.js noCursor() function

Last Updated : 10 Aug, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report
The noCursor() function in p5.js is used to hide the cursor from view. Syntax
noCursor()
Parameters: This function does not accept any parameter. Below program illustrates the noCursor() function in p5.js: Example-1: javascript
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);
}
Output: Example-2: javascript
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);
}
Output: Reference: https://p5js.org/reference/#/p5/noCursor

Next Article

Similar Reads