correctly set up background color in mobile example (#12384)

# Objective

- Since #11165, the button in the mobile example doesn't visually react
to touches

## Solution

- Correctly set up the background color
This commit is contained in:
François Mockers 2024-03-11 19:36:52 +01:00 committed by GitHub
parent 879b170f28
commit 40732148da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,18 +104,22 @@ fn setup_scene(
// Test ui // Test ui
commands commands
.spawn(ButtonBundle { .spawn((
style: Style { ButtonBundle {
justify_content: JustifyContent::Center, style: Style {
align_items: AlignItems::Center, justify_content: JustifyContent::Center,
position_type: PositionType::Absolute, align_items: AlignItems::Center,
left: Val::Px(50.0), position_type: PositionType::Absolute,
right: Val::Px(50.0), left: Val::Px(50.0),
bottom: Val::Px(50.0), right: Val::Px(50.0),
bottom: Val::Px(50.0),
..default()
},
image: UiImage::default().with_color(Color::NONE),
..default() ..default()
}, },
..default() BackgroundColor(Color::WHITE),
}) ))
.with_children(|b| { .with_children(|b| {
b.spawn( b.spawn(
TextBundle::from_section( TextBundle::from_section(