[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
SlideShare a Scribd company logo
USING PROCESSING FROM
     INTELLIJ IDEA
Start a new intellij project
Processing in intellij
Name your project
Nothing to do here, just click Next
First time you create a new project in Intellij
          you have to select a JSDK
Click „New“ and select JSDK
Its a bit strange cause there is nothing to select,
                but just click choose
Click Finish
Now add processings core.jar to your project.
         File→Project Structure
Create a new global library
Click „Attach Classes“and choose the path to processing app.
              Note on mac you can navigate inside the .app file
Now write your sketch. Create a new class in your src folder.
                   Right Click on your source folder.
Start writing and enjoy auto complete while typing
Code suggest
Processing in intellij
Run your sketch
Processing in intellij
Create the data folder in the root of your project.
Right click on the root folder →New →Directory
Basic sketch skelleton
import processing.core.PApplet;

public class Sketch1 extends PApplet {

    public void setup() {}


 public void draw(){}

}
Wanna have fullscreen mode?
static public void main(String args[]) {

 PApplet.main(new String[] { "--present",
"yourPackageName.yourClassName" });
}
Some differences from processing

color cl = color (255, 0, 0);
becomes
int cl = color (255, 0, 0);

float f = 1.2;
becomes
float f = 1.2f;

mouseMoved(){}, draw(){}, keyPressed(){} etc.
becomes
public mouseMoved(){}, public draw(){},
public keyPressed(){}
Need another library
Download and unzip the library
Choose File→Project Structure
Same way as adding processings core.jar
Using OPENGL
Add opengl.jar, jogl.jar and gluegen-rt.jar like the core.jar

Note, On OSX the libraries are located at:
Processing.app/Contents/Resources/Java/libraries/opengl/library
Copy them to a folder of your choice.
Add
-Djava.library.path=Path/toThe/opengl.jarFile
to the VM Parameters
Got java.lang.OutOfMemoryError: Java heap space
Add
-Xmx1024m
to the VM Parameters

More Related Content

Processing in intellij

Editor's Notes