is there a way to set a maximum window size?
in particular I am trying to prevent content overflow by limiting the maximum window size
void setup() {
// initial window size
size(640, 360, P2D);
// allow window to be resized
surface.setResizable(true);
view.setup(P2D);
callOnSizeChanged(view, 720, 480);
verticalScrollBar.onOverflow = verticalScrollBar.new OverflowRunnable() {
@Override
public void run(int value) {
size(width, value, P2D);
}
};
horizontalScrollBar.onOverflow = horizontalScrollBar.new OverflowRunnable() {
@Override
public void run(int value) {
size(value, height, P2D);
}
};
verticalScrollBar.setup(P2D);
horizontalScrollBar.setup(P2D);
verticalScrollBar.document = view;
horizontalScrollBar.document = view;
}
but I get
When not using the PDE, size() can only be used inside settings().
Remove the size() method from setup(), and add the following:
public void settings() {
size(720, 472, "processing.opengl.PGraphics2D");
}
IllegalStateException: size() cannot be used here, see https://processing.org/reference/size_.html
at
horizontalScrollBar.onOverflow = horizontalScrollBar.new OverflowRunnable() {
@Override
public void run(int value) {
> size(value, height, P2D);
}
};