[orx-parameters, orx-property-watchers, orx-file-watcher, orx-gui] Add @PathParameter, file watcher delegates and property delegates
This commit is contained in:
28
orx-jvm/orx-gui/src/demo/kotlin/DemoPath01.kt
Normal file
28
orx-jvm/orx-gui/src/demo/kotlin/DemoPath01.kt
Normal file
@@ -0,0 +1,28 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.PathParameter
|
||||
import org.openrndr.extra.propertywatchers.watchingImagePath
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
|
||||
val settings = @Description("Settings") object {
|
||||
@PathParameter("image", extensions = ["jpg", "png"], order = 10)
|
||||
var imagePath = "demo-data/image-001.png"
|
||||
|
||||
val image by watchingImagePath(::imagePath) {
|
||||
it
|
||||
}
|
||||
}
|
||||
gui.add(settings)
|
||||
extend(gui)
|
||||
extend {
|
||||
drawer.image(settings.image)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,6 @@ import org.openrndr.shape.Circle
|
||||
*/
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
|
||||
Reference in New Issue
Block a user