[openrndr-demos] Add rectangle batch demos

This commit is contained in:
Edwin Jakobs
2020-07-21 13:58:27 +02:00
parent b4908b3cd8
commit c6a883f6b9
6 changed files with 87 additions and 29 deletions

View File

@@ -0,0 +1,23 @@
// Dynamic rectangle batches
import org.openrndr.application
import org.openrndr.color.ColorRGBa
fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.GRAY)
drawer.fill = ColorRGBa.PINK
drawer.stroke = ColorRGBa.WHITE
drawer.strokeWeight = 2.0
drawer.rectangles {
for (y in 0 until height/20) {
for (x in 0 until width/20) {
rectangle(x * 20.0, y * 20.0, 10.0, 15.0, (x + y) * 10.0 + seconds*90.0)
}
}
}
}
}
}