[orx-shade-styles] Write comments on demos
This commit is contained in:
@@ -11,6 +11,16 @@ import org.openrndr.math.transforms.transform
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.cos
|
||||
|
||||
/**
|
||||
* Animated demonstration on how to use the `clip` shade style to mask-out
|
||||
* part of an image (or anything else drawn while the shade style is active).
|
||||
* The clipping uses the `CONTAIN` fit mode.
|
||||
*
|
||||
* This example uses a rotating `star`-shaped clipping with 24 sides.
|
||||
* Other available clipping shapes are `circle`, `rectangle`, `line` and `ellipse`.
|
||||
*
|
||||
* Press a mouse button to toggle the `feather` property between 0.0 and 0.5.
|
||||
*/
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
@@ -25,10 +35,8 @@ fun main() = application {
|
||||
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
extend {
|
||||
|
||||
val grid = drawer.bounds.grid(3, 3)
|
||||
for ((index, cell) in grid.flatten().withIndex()) {
|
||||
|
||||
drawer.shadeStyle = clip {
|
||||
clipFit = FillFit.CONTAIN
|
||||
feather = gf
|
||||
|
||||
Reference in New Issue
Block a user