Toggle between windowed and fullscreen?

edited October 2016 in Questions about Code

Hello , I'm starting with processing and I have some difficulties with fullscreen.
I already write a code to switch between windowed and fullscreen , but there is a gap at the bottom of the window :
http://i.imgur.com/EOO6Ypd.png

Here is the code part for fullscreen:

if (key=='f') {
if (fullscreen == false) {
fullscreen = true;
surface.setSize(displayWidth, displayHeight);
surface.setLocation(-8, -31);
surface.setAlwaysOnTop(true);
} else {
fullscreen = false;
surface.setSize(1280, 720);
surface.setLocation(10, 10);
surface.setAlwaysOnTop(false);
}
} <

Is there a solution to this?

Answers

  • Dunno... Just maybe make another instance of your sketch.
    1 w/ fullScreen(); the other w/o it. *-:)
    Then control which 1 is active w/ setVisible(true); + loop();.
    At the same time, toggle the other w/ setVisible(false); + noLoop();.

Sign In or Register to comment.