Last active
April 28, 2023 18:37
-
-
Save wrightwriter/98a7c5cdeaccd28bb599f3561de3a52d to your computer and use it in GitHub Desktop.
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
import com.krab.lazy.*; | |
import processing.core.PApplet | |
class Sketch : PApplet() { | |
companion object { | |
fun run() { | |
val art = Sketch() | |
art.runSketch() | |
} | |
} | |
lateinit var gui: LazyGui | |
override fun settings() { | |
size(800,800,P2D) | |
} | |
override fun setup() { | |
this.gui = LazyGui(this) | |
} | |
override fun draw() { | |
background(gui.colorPicker("bg").hex); | |
} | |
} | |
fun main(args: Array<String>) { | |
Sketch.run() | |
} |
Author
wrightwriter
commented
Mar 14, 2023
- Create new IntelliJ Kotlin JVM project, without Gradle/Maven
- Go to Project Structure and add the processing/core/library/ folder to Libraries
- Add LazyGui.jar to Libraries
- For processing 4, set SDK under Project to 17. What worked for me is doing "SDK -> Add SDK -> Download JDK -> Amazon Corretto 17"
- Paste this code in and run
This thread has a discussion on Processing under Kotlin - https://discourse.processing.org/t/writing-processing-in-kotlin/3957/30
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment