Demos: ensure all use fun main() = application {
- Adjust some demo window sizes. - Replace Random.double by Double.uniform - Tweak some demos so screenshots look more interesting
This commit is contained in:
@@ -6,26 +6,23 @@ import org.openrndr.draw.font.loadFace
|
||||
import org.openrndr.extra.shapes.bounds.bounds
|
||||
import org.openrndr.extra.shapes.text.shapesFromText
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
val face =
|
||||
loadFace("https://github.com/IBM/plex/raw/master/packages/plex-mono/fonts/complete/otf/IBMPlexMono-Bold.otf")
|
||||
val shapes = shapesFromText(face, "SUCH\nVECTOR\nSUCH\nTEXT", 150.0)
|
||||
|
||||
val face =
|
||||
loadFace("https://github.com/IBM/plex/raw/master/packages/plex-mono/fonts/complete/otf/IBMPlexMono-Bold.otf")
|
||||
val shapes = shapesFromText(face, "SUCH\nVECTOR\nSUCH\nTEXT", 150.0)
|
||||
|
||||
val bounds = shapes.bounds
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
drawer.translate(-bounds.corner)
|
||||
drawer.translate((width - bounds.width) / 2.0, (height - bounds.height) / 2.0)
|
||||
drawer.shapes(shapes)
|
||||
}
|
||||
val bounds = shapes.bounds
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
drawer.translate(-bounds.corner)
|
||||
drawer.translate((width - bounds.width) / 2.0, (height - bounds.height) / 2.0)
|
||||
drawer.shapes(shapes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user