Undecorated frame

From Processing

Jump to: navigation, search
Versions: 1.0+
Contributors: sojamo
Started: 2008-04-27


In case you are doing a performance and you are using a second screen for the presentation of your sketch, the following code helps you to set the window mode to undecorated and to set the location of the frame right next to your first screen. for another option to use a processing sketch in fullscreen mode you may also consider the fullscreen api library.

As of version 154 you will need to make the frame not displayable using removeNotify();

Source Code

/**
undecoratedframe taken from http://processinghacks.com/hacks:undecoratedframe
@author sojamo
*/
 
import processing.opengl.*;
 
// overwrite PApplets init method
// to set the frame to undecorated=true 
public void init() {
  /// to make a frame not displayable, you can 
  // use frame.removeNotify() 
  frame.removeNotify(); 
 
  frame.setUndecorated(true); 
 
  // addNotify, here i am not sure if you have  
  // to add notify again.   
  frame.addNotify(); 
  super.init();
}
 
void setup() {
  // set the siz of the sketch to the 
  // screen resolution of the second screen
  size(1024,768,OPENGL);
  // set the location of the undecorated frame
  frame.setLocation(screen.width, 0);
}
 
void draw() {
  background(0);
}

Downloads

Related Links

Personal tools