diff --git a/examples/tools/gamepad_viewer.rs b/examples/tools/gamepad_viewer.rs index 32549893c6..c8092c2ebe 100644 --- a/examples/tools/gamepad_viewer.rs +++ b/examples/tools/gamepad_viewer.rs @@ -132,41 +132,40 @@ fn setup(mut commands: Commands, meshes: Res, materials: Res, materials: Res, ) { let mut spawn_trigger = |x, y, button_type| { - commands - .spawn(GamepadButtonBundle::new( + commands.spawn(( + GamepadButtonBundle::new( button_type, meshes.trigger.clone(), materials.normal.clone(), x, y, - )) - .with_children(|parent| { - parent.spawn(( - Transform::from_xyz(0., 0., 1.), - Text(format!("{:.3}", 0.)), - TextFont { - font_size: 13., - ..default() - }, - TextWithButtonValue(button_type), - )); - }); + ), + children![( + Transform::from_xyz(0., 0., 1.), + Text(format!("{:.3}", 0.)), + TextFont { + font_size: 13., + ..default() + }, + TextWithButtonValue(button_type), + )], + )); }; spawn_trigger(-BUTTONS_X, BUTTONS_Y + 145., GamepadButton::LeftTrigger2); @@ -374,18 +358,17 @@ fn setup_triggers( fn setup_connected(mut commands: Commands) { // This is UI text, unlike other text in this example which is 2d. - commands - .spawn(( - Text::new("Connected Gamepads:\n"), - Node { - position_type: PositionType::Absolute, - top: Val::Px(12.), - left: Val::Px(12.), - ..default() - }, - ConnectedGamepadsText, - )) - .with_child(TextSpan::new("None")); + commands.spawn(( + Text::new("Connected Gamepads:\n"), + Node { + position_type: PositionType::Absolute, + top: Val::Px(12.), + left: Val::Px(12.), + ..default() + }, + ConnectedGamepadsText, + children![TextSpan::new("None")], + )); } fn update_buttons(