fullscreen resize setsize
in
Programming Questions
•
2 years ago
Hello,
I would like to put in fullscreen with size that change automaticly with size of the screen resolution of the OS.
Or I want to change size with xml file but it's not possible to change size because size must be in the first line into setup().
void setup() {
size(640, 480); // must be in first line
}
size(640, 480); // must be in first line
}
I try a solution with SoftFullscreen and frame.setSize(1920,1080) :
This solution does'nt work because the draw is not centered !
I try an other solution with setSize without softFullscreen with export application in fullscreen mode but it's not centered
What is the solution
?
import fullscreen.*;
SoftFullScreen fs;
void setup(){
// set size to 640x480
size(640, 480);
// set size to 640x480
size(640, 480);
// 5 fps
frameRate(5);
frameRate(5);
// Create the fullscreen object
fs = new SoftFullScreen(this);
// enter fullscreen mode
fs.enter();
frame.setResizable(true);
frame.dispose();
frame.setUndecorated(true);
}
fs = new SoftFullScreen(this);
// enter fullscreen mode
fs.enter();
frame.setResizable(true);
frame.dispose();
frame.setUndecorated(true);
}
void draw(){
frame.setSize(1920,1080);
println("width = " + width);
println("height = " + height);
background(0);
fill(255, 0, 0);
for(int i = 0; i < 10; i++){
fill(
random(255),
random(255),
random(255)
);
rect(
i*10, i*10,
width - i*20, height - i*20
);
}
}
fill(
random(255),
random(255),
random(255)
);
rect(
i*10, i*10,
width - i*20, height - i*20
);
}
}
Thanks
1