Add screenshot generation
This commit is contained in:
@@ -39,8 +39,10 @@ dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
|
||||
|
||||
demoImplementation(project(":orx-camera"))
|
||||
|
||||
demoImplementation(project(":orx-panel"))
|
||||
demoImplementation("org.openrndr:openrndr-core:$openrndrVersion")
|
||||
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
|
||||
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
|
||||
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
|
||||
demoImplementation(sourceSets.getByName("main").output)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.extra.keyframer.KeyframerFormat
|
||||
import org.openrndr.resourceUrl
|
||||
@@ -13,7 +14,11 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-full-01.json")), format = KeyframerFormat.FULL)
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.fill = animation.color
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.panel.controlManager
|
||||
import org.openrndr.panel.elements.Range
|
||||
@@ -29,8 +30,12 @@ fun main() = application {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(cm)
|
||||
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
@@ -10,7 +11,11 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-01.json")))
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
@@ -12,6 +13,11 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-02.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.fill = animation.color
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
@@ -13,7 +14,11 @@ fun main() = application {
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-expressions-01.json")),
|
||||
parameters = mapOf("cycleDuration" to 2.0))
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
@@ -11,7 +12,11 @@ fun main() = application {
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-repetitions-01.json")))
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
|
||||
Reference in New Issue
Block a user