[orx-shapes] Add alpha shapes with holes using opernndr's Shape (#206)

This commit is contained in:
Steven van den Broek
2021-11-08 17:24:57 +01:00
committed by GitHub
parent 6705ef9737
commit e0fae088c3
3 changed files with 114 additions and 26 deletions

View File

@@ -6,14 +6,14 @@ import kotlin.random.Random
fun main() = application {
program {
val points = List(20) {
val points = List(40) {
Vector2(
Random.nextDouble(width*0.25, width*0.75),
Random.nextDouble(height*0.25, height*0.75)
)
}
val alphaShape = AlphaShape(points)
val c = alphaShape.create()
val c = alphaShape.createContour()
extend {
drawer.fill = ColorRGBa.PINK
drawer.contour(c)