[orx-gui] Fix multi-window support. Add WindowedGUI
This commit is contained in:
@@ -19,10 +19,9 @@ fun main() = application {
|
||||
}
|
||||
}
|
||||
|
||||
val gui = GUI(GUIAppearance(barWidth = 400))
|
||||
val gui = GUI(GUIAppearance(baseColor = ColorRGBa.GRAY.opacify(0.9), barWidth = 400))
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
|
||||
|
||||
val settings = @Description("Settings") object {
|
||||
@DoubleParameter("radius", 0.0, 100.0)
|
||||
var radius = 50.0
|
||||
|
||||
32
orx-jvm/orx-gui/src/demo/kotlin/DemoMultiWindow01.kt
Normal file
32
orx-jvm/orx-gui/src/demo/kotlin/DemoMultiWindow01.kt
Normal file
@@ -0,0 +1,32 @@
|
||||
import org.openrndr.WindowConfiguration
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.extra.parameters.*
|
||||
import org.openrndr.window
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
/**
|
||||
* Demonstration of multi window GUI in the manual way
|
||||
*/
|
||||
fun main() {
|
||||
// skip this demo on CI
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
exitProcess(0)
|
||||
}
|
||||
application {
|
||||
program {
|
||||
val settings = object {
|
||||
@DoubleParameter("radius", 10.0, 100.0)
|
||||
var radius = 10.0
|
||||
}
|
||||
window(WindowConfiguration(width = 200, resizable = true)) {
|
||||
val gui = GUI()
|
||||
gui.add(settings)
|
||||
extend(gui)
|
||||
}
|
||||
extend {
|
||||
drawer.circle(drawer.bounds.center, settings.radius)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
32
orx-jvm/orx-gui/src/demo/kotlin/DemoMultiWindow02.kt
Normal file
32
orx-jvm/orx-gui/src/demo/kotlin/DemoMultiWindow02.kt
Normal file
@@ -0,0 +1,32 @@
|
||||
import org.openrndr.WindowConfiguration
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.extra.gui.WindowedGUI
|
||||
import org.openrndr.extra.parameters.*
|
||||
import org.openrndr.window
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
/**
|
||||
* Demonstration of multi window GUI using WindowedGUI extension
|
||||
*/
|
||||
fun main() {
|
||||
// skip this demo on CI
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
exitProcess(0)
|
||||
}
|
||||
application {
|
||||
program {
|
||||
val settings = object {
|
||||
@DoubleParameter("radius", 10.0, 100.0)
|
||||
var radius = 10.0
|
||||
}
|
||||
val gui = WindowedGUI()
|
||||
gui.add(settings)
|
||||
extend(gui)
|
||||
|
||||
extend {
|
||||
drawer.circle(drawer.bounds.center, settings.radius)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user