We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to provide a minimum window size for a window that can be resized. Currently, I'm achieving this with the following:
void setup() {
size(400, 300);
pixelDensity(displayDensity());
frameRate(20);
surface.setResizable(true);
}
void draw() {
// Deal with window size:
if (width < 400) {
surface.setSize(400, height);
}
if (height < 300) {
surface.setSize(width, 300);
}
}
While this does work, it's gittery as you'd expect. If you drag the corner or edge of the window to make it smaller than the lower limit, it looks very unpleasant.
I've done plenty of googling and there are lots of examples of how to do this in Processing 2 and oder, perhaps the cleanest uses frame.setMinimumSize(); but of course in P3 this is no longer available - there is no similar PSurface method.
Does anyone know how this 'should' be done now?
Answers
Thanks for the code, but I'm getting: No library found for processing.awt.PSurfaceAWT
It is a warning rather than an error so can ignore this message.
The following code is GoTOLoop's code but done with setup and draw methods
Thanks to you both. I don't know what I did wrong when I threw GoTOLoop's code in, but I must have missed something.
Cheers