Simple demo #15

This commit is contained in:
2025-08-02 05:48:57 -05:00
parent 598ab5b54d
commit 2b0d85549f
2 changed files with 9 additions and 14 deletions
+7
View File
@@ -0,0 +1,7 @@
use osui::prelude::*;
pub fn app() -> Rsx {
rsx! {
"Hello, World"
}
}
+2 -14
View File
@@ -1,22 +1,10 @@
mod demos;
use osui::prelude::*;
fn main() -> std::io::Result<()> {
let screen = Screen::new();
screen.extension(VelocityExtension);
let count = use_state(0);
rsx! {
@Velocity(20, 0);
@Transform::new();
static "Count: {count}"
}
.draw(&screen);
std::thread::spawn(move || loop {
**count.get() += 1;
std::thread::sleep(std::time::Duration::from_millis(100));
});
demos::app().draw(&screen);
screen.run()
}