I’m a big fan of Processing, but I’m disappointed with lack of a reusable java library. This post explain some details about it.
package name.lemerdy.sebastian.processing import processing.core.PApplet class GraphicExperiment extends PApplet: override def settings(): Unit = size(640, 320) override def draw(): Unit = background(color(255)) stroke(color(0)) line(width / 2f, 0, width / 2f, height.toFloat) if mousePressed then point(45f, 33f) @main def launch(): Unit = PApplet.main(classOf[GraphicExperiment])
Please note that
PApplet is a legacy name that no longer refers to old Java Applet.
Here is a sample result of this code:
Unfortunately, I think they don’t want to put too much effort on distributing Processing as a Java
library. It looks like they want users to use their sketchbook interface instead. As a consequence,
core.jar is not
available into maven central repository and needs to be built with antique tool.
cd .. git clone firstname.lastname@example.org:processing/processing4.git cd processing4/build ant build cp ../core/library/core.jar ../../lib/
lib is a convenient sbt convention that allow any scala project to include theses files into compile and runtime
classpath. It is documented as Unmanaged dependencies.