Files
orx/orx-delegate-magic
Abe Pazos c8f7dd52c6 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
2025-01-26 20:57:04 +01:00
..
2023-06-02 06:59:02 +00:00

orx-delegate magic

Collection of magical property delegators. For tracking variable change or interpolate towards the value of a variable.

Delegated properties

Kotlin documentation

Property smoothing

val state = object {
    var radius = 10.0
}

val smoothRadius by smoothing(state::radius)

Property dynamics

val state = object {
    var radius = 10.0
}

val dynamicRadius by springForcing(state::radius)

Property tracking

val state = object {
    var radius = 10.0
}

val radiusHistory by tracking(state::radius)

Demos

DemoDifferencing01

source code

DemoDifferencing01Kt

DemoFollowing01

source code

DemoFollowing01Kt

DemoSmoothing01

source code

DemoSmoothing01Kt

DemoSpring01

source code

DemoSpring01Kt