Created
August 31, 2017 12:21
-
-
Save kadirmalak/7a89bdb27a18d3c7b63cef8d0c28dfe4 to your computer and use it in GitHub Desktop.
Using Processing with Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package processingscala | |
import processing.core.{PApplet, PConstants} | |
object Main extends PApplet { | |
def main(args:Array[String]) = { | |
PApplet.main("processingscala.Main") | |
} | |
} | |
class Main extends PApplet { | |
override def setup() = { | |
background(255, 255, 255) | |
} | |
override def settings() = { | |
size(640, 480, PConstants.P3D) | |
} | |
override def draw() = { | |
if (mousePressed) fill(0) | |
else fill(255) | |
ellipse(mouseX, mouseY, 80, 80) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment