[orx-composition] reverse argument order in draw()

Add demos with comments
This commit is contained in:
Abe Pazos
2025-08-27 11:26:35 +02:00
parent bbb243bc63
commit 168d1ed2d0
6 changed files with 151 additions and 21 deletions

View File

@@ -4,9 +4,18 @@ import org.openrndr.extra.composition.ClipMode
import org.openrndr.extra.composition.composition
import org.openrndr.extra.composition.drawComposition
/**
* Demonstrates how to draw a Composition and how to use
* `ClipMode.REVERSE_DIFFERENCE` to clip shapes.
*
* The first shape clips part of the second one away,
* producing a shape that seems to be behind the first one.
*
* Without clipping, the second circle would cover part of the first one.
*/
fun main() = application {
program {
val cd = drawComposition {
val composition = drawComposition {
fill = null
circle(width / 2.0, height / 2.0, 100.0)
@@ -15,10 +24,9 @@ fun main() = application {
circle(width / 2.0 + 50.0, height / 2.0, 100.0)
}
extend {
drawer.clear(ColorRGBa.PINK)
drawer.composition(cd)
drawer.composition(composition)
}
}
}