Remove unnecessary uses of "takeScreenshot" (#349)

This commit is contained in:
Abe Pazos
2024-09-02 12:15:44 +02:00
committed by GitHub
parent 141d1fa789
commit f713ca3a3d
25 changed files with 34 additions and 141 deletions

View File

@@ -33,19 +33,6 @@ fun main() = application {
Note that drawing inside the `repeat` action has no effect. Have a look at the demos listed below for an example of
`repeat` triggered drawing.
## Demos
* [Simple `repeat` demonstration](src/demo/kotlin/DemoRepeat01.kt)
* [A `repeat` demonstration with drawing](src/demo/kotlin/DemoRepeat02.kt)
* [Simple `timeOut` demonstration](src/demo/kotlin/DemoTimeOut01.kt)
<!-- __demos__ >
# Demos
[DemoRepeat01Kt](src/demo/kotlin/DemoRepeat01Kt.kt
![DemoRepeat01Kt](https://github.com/openrndr/orx/blob/media/orx-timer/images/DemoRepeat01Kt.png
[DemoRepeat02Kt](src/demo/kotlin/DemoRepeat02Kt.kt
![DemoRepeat02Kt](https://github.com/openrndr/orx/blob/media/orx-timer/images/DemoRepeat02Kt.png
[DemoTimeOut01Kt](src/demo/kotlin/DemoTimeOut01Kt.kt
![DemoTimeOut01Kt](https://github.com/openrndr/orx/blob/media/orx-timer/images/DemoTimeOut01Kt.png
<!-- __demos__ -->
## Demos
### DemoRepeat01

View File

@@ -1,19 +1,10 @@
import org.openrndr.application
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.timer.repeat
fun main() = application {
program {
repeat(2.0) {
println("hello there $seconds" )
}
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
extend {
println("hello there $seconds")
}
}
}
}

View File

@@ -1,7 +1,6 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.events.Event
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.timer.repeat
/**
@@ -19,11 +18,6 @@ fun main() = application {
// -- we can not draw here, so we relay the repeat signal to the event
event.trigger(null)
}
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
extend {
drawer.clear(ColorRGBa.PINK)
// -- by explicitly calling deliver we know that the drawing code in the listener will be

View File

@@ -1,16 +1,10 @@
import org.openrndr.application
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.timer.timeOut
fun main() = application {
program {
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
timeOut(2.0) {
println("hello there $seconds" )
println("hello there $seconds")
}
}
}
}