add demos to README.md

This commit is contained in:
Abe Pazos
2025-08-27 18:32:18 +00:00
parent 1489b503d2
commit 700b666e5c
35 changed files with 1430 additions and 356 deletions

View File

@@ -40,21 +40,49 @@ val radiusHistory by tracking(state::radius)
<!-- __demos__ -->
## Demos
### DemoDifferencing01
[source code](src/jvmDemo/kotlin/DemoDifferencing01.kt)
![DemoDifferencing01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoDifferencing01Kt.png)
### DemoFollowing01
[source code](src/jvmDemo/kotlin/DemoFollowing01.kt)
[source code](src/jvmDemo/kotlin/DemoDifferencing01.kt)
### DemoFollowing01
Demonstrates using delegate-magic tools with
[Double] and [Vector2].
The white circle's position uses [following].
The red circle's position uses [smoothing].
`following` uses physics (velocity and acceleration).
`smoothing` eases values towards the target.
Variables using delegates (`by`) interpolate
toward target values, shown as gray lines.
The behavior of the delegate-magic functions can be configured
via arguments that affect their output.
The arguments come in pairs of similar name:
The first one, often of type [Double], is constant,
The second one contains `Property` in its name and can be
modified after its creation and even be linked to a UI
to modify the behavior of the delegate function in real time.
The `Property` argument overrides the other.
![DemoFollowing01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoFollowing01Kt.png)
[source code](src/jvmDemo/kotlin/DemoFollowing01.kt)
### DemoSmoothing01
[source code](src/jvmDemo/kotlin/DemoSmoothing01.kt)
![DemoSmoothing01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoSmoothing01Kt.png)
[source code](src/jvmDemo/kotlin/DemoSmoothing01.kt)
### DemoSpring01
[source code](src/jvmDemo/kotlin/DemoSpring01.kt)
![DemoSpring01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-delegate-magic/images/DemoSpring01Kt.png)
[source code](src/jvmDemo/kotlin/DemoSpring01.kt)