rmsthebest / bevy-compose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bevy-compose

Crates.io version docs.rs docs CI status

Reactive UI framework for Bevy

fn ui(count: Res<Count>) -> impl Compose {
    (
        format!("High five count: {}", count.0),
        flex("Up high!").on_click(|mut count: ResMut<Count>| count.0 += 1),
        flex("Down low!").on_click(|mut count: ResMut<Count>| count.0 -= 1),
    )
}

Components are also supported with lazy(|player_query: Query<&mut Player>| { ... }

Inspiration

This crate is inspired by Xilem and SwiftUI with its typed approach to reactivity.

About

License:Apache License 2.0


Languages

Language:Rust 100.0%