Files
orx/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt
2024-01-23 09:38:43 +01:00

18 lines
527 B
Kotlin

package primitives
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.primitives.RoundedRectangle
import kotlin.math.cos
fun main() = application {
program {
extend {
drawer.fill = ColorRGBa.WHITE
drawer.stroke = ColorRGBa.PINK
val radius = cos(seconds) * 20.0 + 20.0
val rectangle = RoundedRectangle(50.0, 50.0, width - 100.0, height - 100.0, radius)
drawer.contour(rectangle.contour)
}
}
}