edit upload recent print
Search

                                          



* WikiDocs

Main » ProcessingApps

Processing Sketches as Applications

  • There will likely be times when you want to run your Processing program as an application, instead of as an a applet (to run in full-screen-mode, for example). To do so, add the following method to your sketch:


      public static void main(String[] args) { 

          PApplet.main(new String[]{ "--present", MySketchName.class.getName() });
}


  • Then (from the eclipse menu), select Run -> Run-As -> Java Application.
  • Other options for applications (besides fullscreen, "--present") follow:
      --location=x,y        upper-lefthand corner of where the applet
                          should appear on screen. if not used,
                          the default is to center on the main screen.

      --present             put the applet into full screen presentation
                          mode. requires java 1.4 or later.

      --hide-stop           use to hide the stop button in situations where
                          you don't want to allow users to exit. also
                          see the FAQ on information for capturing the ESC
                          key when running in presentation mode.

      --stop-color          color of the 'stop' text used to quit an
                          sketch when it's in present mode.

      --bgcolor=#xxxxxx     background color of the window.

      --sketch-path         location of where to save files from functions
                          like saveStrings() or saveFrame(). defaults to
                          the folder that the java application was
                          launched from, which means if this isn't set by
                          the pde, everything goes into the same folder
                          as processing.exe.

      --display=n           set what display should be used by this applet.
                          displays are numbered starting from 1.


   NOTE: See this link if you are using Eclipse and want to enable Processing-style exports.


Instructor: Daniel C. Howe

Resources

     MORE

Page last modified on March 13, 2010, at 05:56 PM EST