bevy_basic_ui/hud/
systems.rs

1use crate::styles::CENTRAL_PANEL_STYLES;
2use bevy::prelude::*;
3
4use super::components::Hud;
5
6pub fn spawn_hud(commands: Commands, asset_server: Res<AssetServer>) {
7    build_hud(commands, asset_server);
8}
9
10pub fn build_hud(mut commands: Commands, _asset_server: Res<AssetServer>) -> Entity {
11    commands
12        .spawn((
13            NodeBundle {
14                style: CENTRAL_PANEL_STYLES,
15                ..default()
16            },
17            Hud,
18        ))
19        .id()
20}