Make program not be opened until it is done loading

Hi! Ive been trying to make my programm be minimized till it is done loading.

My code doesn’t work however and I haven’t seen a topic asking this.

void setup() {
  surface.setVisible(false);
  size(960, 540, P2D);
  
  delay(1000);
}

void draw() {
  surface.setVisible(true);
  background(0);
}

Thanks for any help! :slight_smile:

Maybe size() as first command

Or use the function settings, check reference

It doesn’t work with P2D (OpenGL) but this works (Java AWT)

void setup() {
  size(960, 540);
  surface.setVisible(false);
  delay(5000);
}

void draw() {
  surface.setVisible(true);
  background(0);
}

Hello @Noodlybanan,

Try this:

void setup() 
  {
  size(400, 400, P2D); // Works with thread("visible")
  //size(400, 400);  // Works!
  surface.setVisible(false);
  thread("visible");
  }

void draw() 
  {
  background(255, 255, 0);
  println(frameCount);
  }  
  
void visible()
  {
  delay(5000);
  surface.setVisible(true);
  surface.setLocation(100, 100);
  }

Reference here gave me some insight:
surface.setVisible() on different renderers - Processing 2.x and 3.x Forum

:)

Thank you for your help!