New gradle/kts based OPENRNDR program template
This commit is contained in:
30
src/main/kotlin/TemplateProgram.kt
Normal file
30
src/main/kotlin/TemplateProgram.kt
Normal file
@@ -0,0 +1,30 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.FontImageMap
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.draw.tint
|
||||
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 768
|
||||
height = 576
|
||||
}
|
||||
|
||||
program {
|
||||
|
||||
val image = loadImage("file:data/images/pm5544.png")
|
||||
val font = FontImageMap.fromUrl("file:data/fonts/IBMPlexMono-Regular.ttf", 64.0)
|
||||
|
||||
extend {
|
||||
drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
|
||||
drawer.image(image)
|
||||
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.circle(Math.cos(seconds)*width/2.0+width/2.0, Math.sin(0.5*seconds)*height/2.0 + height/2.0, 140.0)
|
||||
|
||||
drawer.fontMap = font
|
||||
drawer.fill = ColorRGBa.WHITE
|
||||
drawer.text("OPENRNDR", width/2.0, height /2.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user