Closed swinton closed 14 years ago
well, the size of the sketch should always be the size of the sketch :) what exactly goes wrong? in this case the sketch should be 640x480, the screen resolution should not switch and when in fullscreen mode you should have a black spacing border around your sketch. is that what is happening?
Yep, that is what is happening (I'm getting the black border).
I think I've sorted this now, by explicitly setting the frame and sketch size in draw(), depending on whether we're in full-screen mode, i.e.:
import fullscreen.*; FullScreen fs; void setup() { size(640, 480); fs = new FullScreen(this); } void draw() { if (fs.isFullScreen()) { // change the sketch size for full-screen mode size(screen.width, screen.height); frame.setSize(screen.width, screen.height + 22); fs.setResolution(screen.width, screen.height); } else { size(640, 480); frame.setSize(640, 480 + 22); fs.setResolution(640, 480); } // start sketching... :) }
actually this is exactly expected behaviour, i think what you want is simply this:
void setup(){ // set size to 640x480 size(640, 480);
// 5 fps frameRate(5);
// Create the fullscreen object fs = new FullScreen(this);
fs.setResolution( 640, 480 ); // or use fs.setResolution( width, height ) instead!
// enter fullscreen mode fs.enter(); }
(without your extra code from draw)
in the next version some kind of automatic scaling to the screen size will be added, but it's gonna be a bit of wait. until then you're stuck with this behaviour.
sorry, have to close because it's not a bug, but your wish will be taken care of (one day...)
I'm trying to set full screen resolution to the screen.width and screen.height but it doesn't seem to be supported, my sketch just defaults to the sketch size, i.e.
Any suggestions for making this work?