Add screenshot generation

This commit is contained in:
Edwin Jakobs
2020-04-22 21:56:08 +02:00
parent 6a29853c71
commit 60a64806fc
66 changed files with 1316 additions and 84 deletions

View File

@@ -28,4 +28,8 @@ Using the `Easing` enumeration
```kotlin
val et = Easing.QuadIn.function(t, 0.0, 1.0, 1.0)
```
```
## Demos
[DemoEasings01Kt](src/demo/kotlin/DemoEasings01.kt)
![Screenshot](images/DemoEasings01Kt.png)

View File

@@ -14,6 +14,7 @@ dependencies {
demoImplementation(project(":orx-camera"))
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)

View File

@@ -1,11 +1,11 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extras.easing.*
import org.openrndr.math.Vector2
fun main() {
application {
configure {
width = 1280
height = 1080
@@ -19,14 +19,17 @@ fun main() {
points.add(Vector2(i*10.0, y))
}
drawer.lineStrip(points)
drawer.stroke = ColorRGBa.GRAY
drawer.lineSegment(0.0, 40.0, 400.0, 40.0)
drawer.lineSegment(0.0, 20.0, 400.0, 20.0)
}
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
extend {
drawer.stroke = ColorRGBa.WHITE
@@ -62,9 +65,7 @@ fun main() {
::easeBounceIn,
::easeBounceOut,
::easeBounceInOut
)
var i = 0
for (f in functions) {
drawEasing(f)
@@ -78,5 +79,4 @@ fun main() {
}
}
}
}