Skip to content

Commit

Permalink
Feedback from @rparrett
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile committed Jan 9, 2025
1 parent c2758b1 commit b00e303
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/ui/directional_navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn reset_button_after_interaction(
}
}

// We're spawning a simple 3x3 grid of buttons
// We're spawning a simple grid of buttons and some instructions
// The buttons are just colored rectangles with text displaying the button's name
fn setup_ui(
mut commands: Commands,
Expand Down Expand Up @@ -126,10 +126,10 @@ fn setup_ui(
Text::new("Use arrow keys or D-pad to navigate. \
Click the buttons, or press Enter / the South gamepad button to interact with the focused button."),
Node {
width: Val::Px(200.0),
width: Val::Px(300.0),
justify_content: JustifyContent::Center,
align_items: AlignItems::Center,
margin: UiRect::all(Val::Px(16.0)),
margin: UiRect::all(Val::Px(12.0)),
..default()
},
))
Expand All @@ -139,7 +139,7 @@ fn setup_ui(
let grid_root_entity = commands
.spawn(Node {
display: Display::Grid,
// Allow the grid to take up the full height and width of the window
// Allow the grid to take up the full height and the rest of the width of the window
width: Val::Percent(60.),
height: Val::Percent(100.),
// Set the number of rows and columns in the grid
Expand Down Expand Up @@ -184,7 +184,7 @@ fn setup_ui(
// Add a text element to the button
.with_child((
Text::new(button_name),
// And center the text within the label
// And center the text if it flows onto multiple lines
TextLayout {
justify: JustifyText::Center,
..default()
Expand Down

0 comments on commit b00e303

Please sign in to comment.