[orx-composition] reverse argument order in draw()
Add demos with comments
This commit is contained in:
@@ -3,10 +3,22 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.composition.ClipMode
|
||||
import org.openrndr.extra.composition.composition
|
||||
import org.openrndr.extra.composition.drawComposition
|
||||
import org.openrndr.extra.svg.saveToFile
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Draws a composition using 3 circles and `ClipMode.REVERSE_DIFFERENCE`.
|
||||
*
|
||||
* A println() demonstrates that the result contains 3 shapes:
|
||||
* a complete circle, a moon-like shape, and a shape with two small black areas.
|
||||
*
|
||||
* One way to verify this is by saving the design as an SVG file and opening
|
||||
* it in vector editing software.
|
||||
*
|
||||
*/
|
||||
fun main() = application {
|
||||
program {
|
||||
val cd = drawComposition {
|
||||
val composition = drawComposition {
|
||||
fill = null
|
||||
clipMode = ClipMode.REVERSE_DIFFERENCE
|
||||
|
||||
@@ -17,9 +29,14 @@ fun main() = application {
|
||||
circle(width / 2.0, height / 2.0, 100.0)
|
||||
}
|
||||
|
||||
println(composition.findShapes().size)
|
||||
|
||||
// save svg to a File
|
||||
//composition.saveToFile(File("/path/to/design.svg"))
|
||||
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
drawer.composition(cd)
|
||||
drawer.composition(composition)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user