How to make processing full screen and close processing?

edited December 2015 in Using Processing

Is there any way to make processing 3.0 full screen?

Also is there any way to make a close button to close it?

Answers

  • Answer ✓

    Yes you can run processing in fullscreen-mode, and it's actually pretty simple. Just use fullScreen() instead of size().

    The close-button would have to be made by yourself, here is an example:

    void setup() {
      // fullscreen-mode
      fullScreen();
    }
    void draw() {
      // draw a close button
      fill(255);
      rect(20, 20, 50, 30);
      fill(0);
      text("close", 30, 40);
    }
    
    void mousePressed() {
      // check horizontal position
      if (mouseX >= 20 && mouseX < 70) {
        // check vertical position
        if (mouseY >= 20 && mouseY < 50) {
          // close programm
          exit();
        }
      }
    }
    
  • I see, Thanks for the help. This makes a game more interesting then a box that has a defined size.

  • edited December 2015

    -Error processing repeated this.

  • Can't seem to find an answer anywhere else...but how do i toggle fullscreen() while sketch is running? could I use surface.setSize(w, h) ?

Sign In or Register to comment.