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:
Abe Pazos
2025-01-26 20:57:04 +01:00
parent 1975a820fc
commit c8f7dd52c6
116 changed files with 2889 additions and 2942 deletions

View File

@@ -8,33 +8,31 @@ import org.openrndr.extra.shapes.primitives.intersection
* Demonstrate rectangle-rectangle intersection
* @see <img src="https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleIntersection01Kt.png">
*/
fun main() {
application {
configure {
width = 720
height = 720
}
program {
val h = drawer.bounds.offsetEdges(-100.0, -10.0)
val v = drawer.bounds.offsetEdges(-10.0, -100.0)
fun main() = application {
configure {
width = 720
height = 720
}
program {
val h = drawer.bounds.offsetEdges(-100.0, -10.0)
val v = drawer.bounds.offsetEdges(-10.0, -100.0)
extend {
drawer.clear(ColorRGBa.WHITE)
extend {
drawer.clear(ColorRGBa.WHITE)
/**
* Find intersection
*/
val i = h.intersection(v)
drawer.fill = ColorRGBa.RED
drawer.rectangle(h)
/**
* Find intersection
*/
val i = h.intersection(v)
drawer.fill = ColorRGBa.RED
drawer.rectangle(h)
drawer.fill = ColorRGBa.BLUE
drawer.rectangle(v)
drawer.fill = ColorRGBa.BLUE
drawer.rectangle(v)
drawer.fill = ColorRGBa.BLACK
drawer.stroke = ColorRGBa.WHITE
drawer.rectangle(i)
}
drawer.fill = ColorRGBa.BLACK
drawer.stroke = ColorRGBa.WHITE
drawer.rectangle(i)
}
}
}
}