Add demo for orx-panel
This commit is contained in:
3
orx-panel/README.md
Normal file
3
orx-panel/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# orx-panel
|
||||||
|
|
||||||
|
The OPENRNDR UI toolkit
|
||||||
16
orx-panel/build.gradle
Normal file
16
orx-panel/build.gradle
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
sourceSets {
|
||||||
|
demo {
|
||||||
|
java {
|
||||||
|
srcDirs = ["src/demo/kotlin"]
|
||||||
|
compileClasspath += main.getCompileClasspath()
|
||||||
|
runtimeClasspath += main.getRuntimeClasspath()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
|
||||||
|
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
|
||||||
|
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
|
||||||
|
demoImplementation(sourceSets.getByName("main").output)
|
||||||
|
}
|
||||||
47
orx-panel/src/demo/kotlin/DemoVerticalLayout01.kt
Normal file
47
orx-panel/src/demo/kotlin/DemoVerticalLayout01.kt
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.extensions.SingleScreenshot
|
||||||
|
import org.openrndr.panel.controlManager
|
||||||
|
import org.openrndr.panel.elements.div
|
||||||
|
import org.openrndr.panel.elements.slider
|
||||||
|
import org.openrndr.panel.style.*
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
program {
|
||||||
|
// -- this block is for automation purposes only
|
||||||
|
if (System.getProperty("takeScreenshot") == "true") {
|
||||||
|
extend(SingleScreenshot()) {
|
||||||
|
this.outputFile = System.getProperty("screenshotPath")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val cm = controlManager {
|
||||||
|
styleSheet(has class_ "side-bar") {
|
||||||
|
this.height = 100.percent
|
||||||
|
this.width = 200.px
|
||||||
|
this.display = Display.FLEX
|
||||||
|
this.flexDirection = FlexDirection.Column
|
||||||
|
this.paddingLeft = 10.px
|
||||||
|
this.paddingRight = 10.px
|
||||||
|
this.background = Color.RGBa(ColorRGBa.GRAY)
|
||||||
|
}
|
||||||
|
styleSheet(has type "slider") {
|
||||||
|
this.marginTop = 25.px
|
||||||
|
this.marginBottom = 25.px
|
||||||
|
}
|
||||||
|
layout {
|
||||||
|
div("side-bar") {
|
||||||
|
slider {
|
||||||
|
label = "Slider 1"
|
||||||
|
}
|
||||||
|
slider {
|
||||||
|
label = "Slider 2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extend(cm)
|
||||||
|
extend {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user