I don't understand why when I use surface.setResizable(true); my draw stops working.

Here’s my code.

int canvasWidth = 800;
int canvasHeight = 600;
int i=0;
void setup() {

    surface.setResizable(true);
}

void draw() {
  circle(100,100,100);
  i++;
  println(i);
}

void settings() {
  size(canvasWidth, canvasHeight);
}

Hello @Nokuraion,

Your draw() is working! Windows 10 and Processing 4.3 used here.

For each cycle of draw() you are:

  • drawing a circle with a fixed size and location painting over the last one
  • updating i and printing it to the console. This means it is working!

An excellent resource for beginners:

There are also resources (tutorials, references, examples, etc.) here:

I suggest you look at the references for each element of your code; draw(), settings(), setup(), circle(), etc. and also some working examples from the references provided.

:)

Hello thank for you reply but that don’t work when i resize my window my background stop drawing and my println also.

1 Like

Your code works as is here with Windows 10 Pro and Processing 4.3

Please provide more information:

Operating system?
Version of Processing?

Does the example in the reference work?

:)

i have Windows 10 Family and Processing 4.3 and the example work while i don’t resize the window