This module serves as a very simple starter with example for using an external IDE (IntelliJ IDEA in particular) with
Processing.
Its main goal is to avoid injecting an PApplet object via the constructor in each class you want to draw. Instead, this project provides two approaches circumvent this problem:
- By using the
ProcessingStarter
class which itself provides the PApplet objectpApplet
or shortp
which then can be directly accessed in your classes. - By extending your classes with
ProcessingWrapper
. There you can use almost every processing command you want
- Clone or download the project
- Open the project in your IDE
- Install the processing libs
- Create a class with a method you want to use for drawing
- Use Import or Wrapper
- Import: Import
ProcessingStarter
in your class. I'd advise to use static import e.g.import static main.java.ProcessingStarter.p;
- Wrapper: Extend your class with
ProcessingWrapper
- Import: Import
- Using
p.
(when using the import approach) you can call all the Processing methods or just call the method directly ( when using wrapper approach)- E.g.
p.frameRate
resp.framerate
will return the current frame rate.
- E.g.
- Start your project by running the main-Method in ProcessingStarter.java
- Also see the provides examples
I implemented and tested this code with Processing version 4.0 Beta 2