Skip to content
Discussion options

You must be logged in to vote

In this particular case, you don't need the NodeBundle, since TextBundle already includes all the necessary components.

But for future references, you can't really create a bundle this way, your best bet is to insert the bundles separately, using a chain of .insert() as follow:

When you actually need to avoid duplicate components in bundles
    commands.spawn(TextBundle::from_section(
        "Player: ",
        TextStyle { font_size: 10.0, color: Color::WHITE, ..default() }
    ))
	.insert(NodeBundle {
        style: Style {
            width: Val::Px(100.0),
            height: Val::Px(20.0),
            ..default()
        },
        background_color: BackgroundColor(Color

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@negasora
Comment options

@nicopap
Comment options

nicopap Oct 27, 2023
Collaborator

@negasora
Comment options

Answer selected by negasora
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants