Tuesday, December 23, 2025
HomeLanguagesJavascriptp5.js noCursor() function

p5.js noCursor() function

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:




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:




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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32456 POSTS0 COMMENTS
Milvus
111 POSTS0 COMMENTS
Nango Kala
6825 POSTS0 COMMENTS
Nicole Veronica
11959 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12038 POSTS0 COMMENTS
Shaida Kate Naidoo
6958 POSTS0 COMMENTS
Ted Musemwa
7203 POSTS0 COMMENTS
Thapelo Manthata
6912 POSTS0 COMMENTS
Umr Jansen
6890 POSTS0 COMMENTS