Demos: ensure all use fun main() = application {
- Adjust some demo window sizes. - Replace Random.double by Double.uniform - Tweak some demos so screenshots look more interesting
This commit is contained in:
@@ -5,28 +5,26 @@ import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.fx.distort.FluidDistort
|
||||
import org.openrndr.extra.fx.patterns.Checkers
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val fd = FluidDistort()
|
||||
val checkers = Checkers()
|
||||
fun main() = application {
|
||||
program {
|
||||
val fd = FluidDistort()
|
||||
val checkers = Checkers()
|
||||
|
||||
val image = colorBuffer(width, height)
|
||||
val distorted = image.createEquivalent()
|
||||
checkers.size = 64.0
|
||||
checkers.apply(emptyArray(), image)
|
||||
val image = colorBuffer(width, height)
|
||||
val distorted = image.createEquivalent()
|
||||
checkers.size = 64.0
|
||||
checkers.apply(emptyArray(), image)
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||
it.delayFrames = 150
|
||||
}
|
||||
}
|
||||
extend {
|
||||
// Ensure >0.01 for a better screenshot
|
||||
fd.blend = (mouse.position.x / width).coerceAtLeast(0.01)
|
||||
fd.apply(image, distorted)
|
||||
drawer.image(distorted)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||
it.delayFrames = 150
|
||||
}
|
||||
}
|
||||
extend {
|
||||
// Ensure >0.01 for a better screenshot
|
||||
fd.blend = (mouse.position.x / width).coerceAtLeast(0.01)
|
||||
fd.apply(image, distorted)
|
||||
drawer.image(distorted)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user