Mouse lagging and can't make fullScreen() in 4K

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

void draw(){
  background(#f097ff);
  drawCursor(mouseX,mouseY);
  text("("+mouseX+","+mouseY+")",width/2,height/2);
}

void drawCursor(float x,float y){
  final float W = width/1920*11.00, H1 = height/1080*16.00, H2 = sqrt(H1*H1-W*W)*14/13;
  fill(0);
  triangle(x,y,x,y+H1,x+W,y+H2);
}

So I’m trying to create a simple alter cursor shape. The problem is the cursor in this program lag severely. That is if I comment the noCursor(),the system’s cursor and the black triangle cursor can’t sync very well.

Also my screen is 3840x2160, but the program only runs under 1080P even with fullScreen().

1 Like

Hi @doesThisReallyMatter (sometimes yes :wink: )

So you have a 4K screen and when you run your sketch it runs fullScreen but the actual resolution is 1920x1080? Did you try to print the width and height values?

Yeah. The last line inside draw()is to print mouseX & Y as (x,y) on the screen, and the maximum it can get is (1919,1079).

BTW I put ‘doesThisReallyMatter’ after ‘user name’ when singing up lol.

1 Like