window resizing in processing
The following processing code shows how to resize a processing window from your code. the resizeApp methdo calculates the difference between the frame size and the size of the actual drawing area and adds it to the new size. then the application-frame is resized.
void setup() {
size(320,200);
}
int col = 0;
void draw() {
background(col);
stroke(255,0,0);
line(0,0,width, height);
line(0,height,width,0);
}
void mousePressed() {
if (col == 0) {
resizeApp( 640, 400 );
col = 255;
} else {
resizeApp( 320, 200 );
col = 0;
}
}
void keyPressed() {
exit();
}
void resizeApp( int w, int h ) {
int delta = frame.getHeight()-height;
resize( w, h );
frame.setSize( w, h + delta );
}
See also:
sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor