#bundle #bevy #ergonomics #ecs #game

bundle_bundle

bundle bundles in a chain

2 releases

0.1.1 Nov 30, 2022
0.1.0 Nov 25, 2022

#2340 in Game dev

MIT/Apache

23KB

bundle_bundle

Extension trait for Bundle with one method bundle that provides an alternative to tuples for building anonymous bundles.

Supports Bevy 0.9

Usage

Add to your project with:

cargo add bundle_bundle

Now where you used a tuple struct:

commands.spawn((
    Text2dBundle::from_section("message", text_style),
    Background(Color::NAVY),
    MessageMarkerComponent,
));

You can instead use:

use bundle_bundle::BundleBundleExt;

commands.spawn(
    Text2dBundle::from_section("message", text_style)
    .bundle(BackgroundColor(Color::NAVY))
    .bundle(MessageMarkerComponent)
);

Examples

cargo run --example hello_world

Dependencies

~15–32MB
~492K SLoC