how to detect presentmode in processing

Nikolaus Gradwohl2009-03-15T10:21:00+00:00

in processing sketches can be run in "present" mode. which means a frame is generated in fullscreen mode and the code of the sketch is centered on the screen.

to change the size of the actual sketch depending on wether presend mode is active or not
the following code can be used

void setup() {
    for ( int i = 0; i < args.length; i ++ ) {
      if ("--present".equals(args[i])) {
        present = true;
        break;
      }
    }
    if (present) {
      size(screen.width,screen.height, OPENGL);
    } else {
      size(600,600, OPENGL);
    }

    // do your normal setup stuff here
}
Tweet This! submit to reddit Digg! Tags: | no comments | no trackbacks

See also:

sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor

Trackbacks

Comments

Leave a response

Leave a comment