The cuicui
framework is a collection of rust crates made for bevy.
cuicui_layout
: A dumb layout algorithm you can rely on, built for and with bevy.cuicui_dsl
and cuicui_chirp
: Two enjoyable ways to spawn scenes in bevy.A tinny example to get you an idea of what you can do with cuicui
.
Shows a blue box with cyan outline in the center of the screen:
use bevy::prelude::*;
use cuicui_layout::{dsl, LayoutRootCamera};
use cuicui_layout_bevy_ui::UiDsl as Dsl;
fn main() {
// Do not forget to add cuicui_layout_bevy_{ui,sprite}::Plugin
App::new()
.add_plugins((DefaultPlugins, cuicui_layout_bevy_ui::Plugin))
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
// Use LayoutRootCamera to mark a camera as the screen boundaries.
commands.spawn((Camera2dBundle::default(), LayoutRootCamera));
dsl! { &mut commands.spawn_empty(),
// Use screen_root to follow the screen's boundaries
Entity(row screen_root) {
// Stuff is centered by default.
Entity(row margin(9.) border(5, Color::CYAN) bg(Color::NAVY)) {
Entity(ui("Hello world!"))
}
}
};
}
Use the cargo run --bin
command to list possible examples, and run them.
We do this because it allows us to have different dependencies between examples.
cuicui_layout
The Usage section of the book is a good starting point.
Please read the Usage section of the book. Skip to the code if you don't care for explanations.
See the ./CHANGELOG.md file.
bevy | latest supporting version |
---|---|
0.12 | 0.12.0 |
0.11 | 0.10.2 |
0.10 | 0.3.0 |
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.