fullscreen in processing

February 18, 2009

some days ago, during some tests with processing, i needed to work in fullscreen. i’ve got a surprise reading through some forums that it doesn’t give a good support for this mode. to make our work easier, there’s a API for this purpose, called FullScreen API.

it’s quite simple. after installation (also quite simple), just create a FullScreen object, initialize it and call its enter method: that’s all. for example:

import fullscreen.*; 

FullScreen fs; 

void setup(){
  size(640, 480); // set size to 640x480
  fs = new FullScreen(this); // Create the fullscreen object
  fs.enter(); // enter fullscreen mode
}

void draw(){
  //draw whatever you want!
}

ps: if you know why processing doesn’t support such basic thing, please, let me know!

further informations
[1] about processing
[2] about FullScreen API
[3] about how to install libraries in processing

About these ads

5 Responses to “fullscreen in processing”

  1. bulanmaster Says:

    i tried this full screen stuff and it works… on 2D. but i also tried it on 3D and nothing… black screen.

    • Nirvana7 Says:

      another approach: just call this method in your setup() method:

      void startFullscreen() {
      JFrame f = new JFrame();
      f.setSize(DISPLAYWIDTH, DISPLAYHEIGHT);
      f.setExtendedState(Frame.MAXIMIZED_BOTH);
      f.setUndecorated(true);
      f.add(this);
      f.setVisible(true);
      }

  2. bulanmaster Says:

    it is easy… just Ctrl+Shift+R and it runs in fullscreen mode…

    • bulanmaster Says:

      -this works for p3d and opengl so you have to make something like:

      size(screen.width, screen.height, P3D);
      or
      size(screen.width, screen.height, OPENGL);

      -and if using opengl should include the:

      frameRate(60);

      60 is only an example, actually the default one as far as i remember

      -and would also like to resize the background image if you have such thing:

      bckgrnd.resize(width, height);

      where bckground is a PImage variable that contains the image that you have as a background…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: