Crates.io | bevy_bundletree |
lib.rs | bevy_bundletree |
version | |
source | src |
created_at | 2024-05-18 22:34:17.560031 |
updated_at | 2024-11-30 22:58:41.459004 |
description | Spawn trees of bundles in the Bevy game engine. |
homepage | https://github.com/Katsutoshii/bevy_bundletree |
repository | https://github.com/Katsutoshii/bevy_bundletree |
max_upload_size | |
id | 1244532 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
bevy_bundletree
Spawn trees of bundles in Bevy to make UI Code more ergonomic.
Define an enum to represent all possible bundles in your tree and derive IntoBundleTree
and BundleEnum
.
use bevy::prelude::*;
use bevy_bundletree::*;
#[derive(IntoBundleTree, BundleEnum)]
enum UiNode {
Node(NodeBundle),
Text(TextBundle),
Button(ButtonBundle),
}
fn setup(mut commands: Commands) {
let tree: BundleTree<UiNode> = NodeBundle::default().with_children([
TextBundle::default().into_tree(),
ButtonBundle::default().into_tree()]);
commands.spawn_tree(tree);
}
bevy | bevy_bundletree |
---|---|
0.15 | 0.3.0 |
0.14 | 0.2.1 |
0.13 | 0.1.1 |