Skip to content

Instantly share code, notes, and snippets.

@b-studios
Created January 22, 2014 13:54
Show Gist options
  • Save b-studios/8559107 to your computer and use it in GitHub Desktop.
Save b-studios/8559107 to your computer and use it in GitHub Desktop.
To use processing with scala: You have to download the processing `core.jar` available at http://processing.org/download/?processingand save it to your `lib/` directory. This gist just illustrates the basic setup necessary to run a processing application.
import processing.core.PApplet
class ProcessingTest extends PApplet {
override def setup() {
size(1024, 768)
background(255)
}
override def draw() {
// Your drawing code
}
}
object ProcessingTest extends App {
PApplet.main("ProcessingTest")
}
@FlorianCassayre
Copy link

For the sbt users, no need to (explicitly) download anything, simply add these lines to your build.sbt file and you're good to go:

libraryDependencies ++= Seq(
  "org.processing" % "core" % "3.0b5",
  "org.processing" % "net" % "3.0b5",
  "org.processing" % "video" % "3.0b5",
  "org.processing" % "serial" % "3.0b5",
  "org.processing" % "pde" % "3.0b5",
  "org.processing" % "pdf" % "3.0b5")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment