add demos to README.md

This commit is contained in:
Abe Pazos
2025-11-22 18:16:54 +00:00
parent 522627ca51
commit 4af2ed3fed
4 changed files with 185 additions and 6 deletions

View File

@@ -37,6 +37,11 @@ Note that drawing inside the `repeat` action has no effect. Have a look at the d
## Demos
### DemoRepeat01
A simple demonstration on using the `repeat` method to execute a function
at regular intervals.
Note that drawing inside the repeat action has no effect.
See DemoRepeat02.kt to learn how to trigger drawing.
![DemoRepeat01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat01Kt.png)
@@ -45,14 +50,29 @@ Note that drawing inside the `repeat` action has no effect. Have a look at the d
### DemoRepeat02
This demonstrates how to combine `repeat {}` with a postponed event to trigger drawing
This demonstrates how to combine `repeat {}` with a postponed event to trigger drawing.
![DemoRepeat02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat02Kt.png)
[source code](src/demo/kotlin/DemoRepeat02.kt)
### DemoRepeat03
Shows how a `repeat` block can update a variable used
for rendering. In this demo, the `opacity` variable is
reduced on every animation frame, and increased to 1.0
every 2 seconds, creating a pulsating animation effect.
![DemoRepeat03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat03Kt.png)
[source code](src/demo/kotlin/DemoRepeat03.kt)
### DemoTimeOut01
Demonstrates the `timeOut` function.
It is similar to the `repeat` function,
but it runs only once after the specified delay in seconds.
![DemoTimeOut01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoTimeOut01Kt.png)