How to keep a shape in center, when the window size is changing?

void setup()
{
  size(800,1200);
  background(200);
  
  
 }
//*****************************

void draw()
{
  
 
  
  stroke(75);
  strokeWeight(5);
  fill(25);
  rect(135,310,500,500);
}
  

use:

width 
and
height

:slight_smile:

1 Like