The function "noCursor()" does not exist

Hello, everyone, I have tapped the following code found as example in https://processing.org/reference/noCursor_.html . While compilation, it told me that the function “noCursor()” does not exist, and The variable “HAND” does not exist. Have you meet any problems like this, thanks a lot for your suggestions.

void setup() {
  fullScreen();
  background(255);
  noCursor();
}

// Press the mouse to hide the cursor
void draw() 
{
  if (mousePressed == true) {
    noCursor();
  } else {
    cursor(HAND);
  }
}

My processing is 3.5.4 in mac pro Mid 2015, with
|SDK Patch Applier v4|1||
|Android SDK Build-Tools|26.0.2||
|Android SDK Platform 28|6||
|Google APIs Intel x86 Atom System Image|10||
|Android SDK Tools|26.1.1||
|Android SDK Platform-Tools|29.0.6||

1 Like

Will not work when running the program in a web browser or in full screen (Present) mode.

Thanks, Chrisir, while, I have launched it in Processing IDE not web browser and disabled the full screen mode, it seems still not work. I guess it’s some problems of library, because I can not even complete the compilation, the error occurred while I build the project.

1 Like

Hi @bowo
This function does not work on P4A.

1 Like

Thanks a lot @noel, by the way, do you have ideal in which version, that function works?

@bowo ===
cursor() does not work in android mode because there is not any cursor object in the standard meaning for android; cursor is only used for list or data base and refers to the position of the item

2 Likes

@akenaton Thanks a lot, got it now.

If anyone want to realize cursor like function in your application, you can code like :

int oldMouseX=0;
int oldMouseY=0;
color oldCorlor;
color colorCursor= color(255,0,0);
color colorCursorTrajectory=color(255,0,255);

boolean bEnableCursorTrajectory=false;//You can set that value to be true, if you want to show cursor trajectory
int CursorSize=10;

void draw() {
  fill(oldCorlor);
  noStroke();
  ellipse(oldMouseX,oldMouseY,CursorSize,CursorSize);
  
  if (bEnableCursorTrajectory){
    stroke(colorCursorTrajectory);
    if (mousePressed == true) {
      strokeWeight(CursorSize);
      strokeCap(ROUND);
      line(mouseX, mouseY, pmouseX, pmouseY); 
    } 
  }
  /**/
  
  //your code here
  
  /**/
  if (mousePressed == true) {
    oldMouseX=mouseX;
    oldMouseY=mouseY;
    oldCorlor=get(oldMouseX,oldMouseY);
    noStroke();
    fill(colorCursor);
    ellipse(mouseX,mouseY,CursorSize,CursorSize); 
  }

}
1 Like