Processing 3: How to setUndecorated(true)

As a reference for other people who need help in the transition from Processing 2 to 3:

Processing 2:

void init() {
    frame.removeNotify();
    frame.setUndecorated(true);
    frame.addNotify();
    super.init();
}

Processing 3:

void settings() {
    fullScreen();
}
void setup() {
    surface.setSize(500,500);
}

Hope this helps!

-Icy

Comments

  • If anyone has problems, report here :D

  • Works like a charm, thanks. But setLocation() seems to do nothing in this new configuration. Anybody able to solve that?

  • Same problem with surface.setLocation(x,y) it don't work !

  • surface.setLocation(x,y) works for me, but I had to put it after all the gui creations.

  • This is pure gold !

    As a side note, you might want to use displayHeight / displayLenght argument inside the surface.setLocation for better portability.

  • edited January 2016

    Anyone knows, how this works with P2D or P3D Renderer? Thanks!

  • edited May 2016

    seems to crash my computer when i use P2D or P3D on my main screen and does some strange sizing on my secondary screen.

    void settings() {
      fullScreen(P2D, 1);
    }
    boolean fullscreen = false;
    
    void setup() {
      size(640, 480);
      surface.setResizable(true);
    }
    
    void draw() {
      background(255);
      stroke(0);
      line(100, 100, width-100, height-100);
    
      if (fullscreen) {
        surface.setSize(displayWidth, displayHeight);
        surface.setLocation(0, 0);
        background(0);
        stroke(255);
        line(100, 100, width-100, height-100);
      } else {
        surface.setSize(640, 480);
      }
    }
    
    void keyPressed() {
      if (key == 'f' || key == 'F') {
        fullscreen = !fullscreen;
      }
    }
    
Sign In or Register to comment.