Rework and fix for orx-parameter/orx-gui ButtonParameter (now ActionParameter)

This commit is contained in:
Edwin Jakobs
2020-02-04 12:24:18 +01:00
parent 9ca639a14a
commit 2738b2f287
5 changed files with 106 additions and 46 deletions

View File

@@ -3,12 +3,17 @@
A collection of annotations and tools that are used to turn Kotlin properties into introspectable parameters. Parameters
are highly suitable for automatically generating user interfaces, but note that this is _not_ what `orx-parameters` does.
For an example (and a highly usable implementation) of generating interfaces from the annotations you are encouraged to check out [`orx-gui`](../orx-gui/README.md).
Currently orx-parameters supplies the following annotations:
- `DoubleParameter`
- `IntParameter`
- `BooleanParameter`
- `TextParameter`
- `DoubleParameter` for `Double` properties
- `IntParameter` for `Int` properties
- `BooleanParameter` for `Boolean` properties
- `TextParameter` for `String` properties
- `ColorParameter` for `ColorRGBa` properties
Additionally there is an `ActionParameter` that can be used to annotate functions without arguments.
## Annotation application
@@ -24,6 +29,12 @@ val foo = object {
@BooleanParameter("a boolean parameter", order = 2)
var b = false
@ActionParameter("a simple action", order = 3)
fun actionFunction() {
// --
}
}
````