Add ApplicationPreload mechanism to collectScreenshots

This commit is contained in:
Edwin Jakobs
2021-08-31 22:43:39 +02:00
parent 46dfc06ab1
commit bf11867232
62 changed files with 94 additions and 379 deletions

View File

@@ -1,6 +1,5 @@
import org.openrndr.application
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.noise.poissonDiskSampling
import org.openrndr.math.Vector2
import org.openrndr.shape.Circle
@@ -8,14 +7,7 @@ import org.openrndr.shape.Circle
fun main() {
application {
program {
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
var points = poissonDiskSampling(200.0, 200.0, 5.0, 10)
val rectPoints = points.map { Circle(Vector2(100.0, 100.0) + it, 3.0) }
points = poissonDiskSampling(200.0, 200.0, 5.0, 10, true) { w: Double, h: Double, v: Vector2 ->
@@ -26,7 +18,6 @@ fun main() {
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.stroke = null
drawer.fill = ColorRGBa.PINK
drawer.circles(rectPoints)