diff options
| author | Edwin Jakobs <edwin@rndr.studio> | 2019-08-01 15:57:24 +0200 |
|---|---|---|
| committer | Edwin Jakobs <edwin@rndr.studio> | 2019-08-01 15:57:24 +0200 |
| commit | a41b530d32c579c27d59857fee900bf9dd8bff9b (patch) | |
| tree | 2041e9f7db508478f467608ad06e193189a3d70c /src | |
| download | art-playground-openrndr-a41b530d32c579c27d59857fee900bf9dd8bff9b.tar.gz art-playground-openrndr-a41b530d32c579c27d59857fee900bf9dd8bff9b.zip | |
New gradle/kts based OPENRNDR program template
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/kotlin/TemplateProgram.kt | 30 | ||||
| -rw-r--r-- | src/main/resources/log4j2.yaml | 20 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/main/kotlin/TemplateProgram.kt b/src/main/kotlin/TemplateProgram.kt new file mode 100644 index 0000000..3187dc8 --- /dev/null +++ b/src/main/kotlin/TemplateProgram.kt @@ -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) + } + } +}
\ No newline at end of file diff --git a/src/main/resources/log4j2.yaml b/src/main/resources/log4j2.yaml new file mode 100644 index 0000000..cdef115 --- /dev/null +++ b/src/main/resources/log4j2.yaml @@ -0,0 +1,20 @@ +Configuration: + status: warn + Appenders: + Console: + name: Console + target: SYSTEM_OUT + PatternLayout: + Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" + File: + append: false + name: File_Appender + fileName: application.log + PatternLayout: + Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" + Loggers: + Root: + level: debug + AppenderRef: + - ref: Console + - ref: File_Appender
\ No newline at end of file |
