Skip to content

Commit 4073214

Browse files
authored
correctly set up background color in mobile example (bevyengine#12384)
# Objective - Since bevyengine#11165, the button in the mobile example doesn't visually react to touches ## Solution - Correctly set up the background color
1 parent 879b170 commit 4073214

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

examples/mobile/src/lib.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,22 @@ fn setup_scene(
104104

105105
// Test ui
106106
commands
107-
.spawn(ButtonBundle {
108-
style: Style {
109-
justify_content: JustifyContent::Center,
110-
align_items: AlignItems::Center,
111-
position_type: PositionType::Absolute,
112-
left: Val::Px(50.0),
113-
right: Val::Px(50.0),
114-
bottom: Val::Px(50.0),
107+
.spawn((
108+
ButtonBundle {
109+
style: Style {
110+
justify_content: JustifyContent::Center,
111+
align_items: AlignItems::Center,
112+
position_type: PositionType::Absolute,
113+
left: Val::Px(50.0),
114+
right: Val::Px(50.0),
115+
bottom: Val::Px(50.0),
116+
..default()
117+
},
118+
image: UiImage::default().with_color(Color::NONE),
115119
..default()
116120
},
117-
..default()
118-
})
121+
BackgroundColor(Color::WHITE),
122+
))
119123
.with_children(|b| {
120124
b.spawn(
121125
TextBundle::from_section(

0 commit comments

Comments
 (0)