Hello,
surface.setResizable(true) : and the sketch window is resizable.
Problem : if width and height are used, they are not updated anymore when you resize the window
(Processing 4.4.4 + Linux Mint)
See this code :
float width2;
float height2;
void setup() {
size(800, 600);
surface.setResizable(true);
textSize(20);
}
void draw() {
width2=width;
height2=height;
background(color(0,0,255));
rectMode(CENTER);
stroke(255);
text("Width : "+width,40,50);
text("Height : "+height,40,100);
// This works :
rect(width2/2,height2/2,100,100);
// This doesn't work !!! WHY ?
//rect(width/2,height/2,100,100);
}
and sometimes, it doesn’t work in any case !