Skip to content

Katsutoshii/bevy_bundletree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bevy_bundletree

License Crates.io Docs

Spawn trees of bundles in Bevy to make UI Code more ergonomic.

Usage

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);
}

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages