use new spawn api

This commit is contained in:
2025-04-29 19:55:40 +02:00
parent 11568d57ed
commit 5cc97da98b
8 changed files with 265 additions and 282 deletions

View File

@@ -82,25 +82,24 @@ fn update_ui(
let show_ui = cam_state.look_around || cam_state.cutscene;
if show_ui {
commands
.spawn((
CameraUi,
Node {
margin: UiRect::top(Val::Px(20.))
.with_left(Val::Auto)
.with_right(Val::Auto),
justify_content: JustifyContent::Center,
..default()
},
))
.with_child((
commands.spawn((
CameraUi,
Node {
margin: UiRect::top(Val::Px(20.))
.with_left(Val::Auto)
.with_right(Val::Auto),
justify_content: JustifyContent::Center,
..default()
},
children![(
Node {
display: Display::Block,
position_type: PositionType::Absolute,
..default()
},
ImageNode::new(assets.camera.clone()),
));
)],
));
} else {
for entity in query.iter() {
commands.entity(entity).despawn();