|
|
|
@ -536,7 +536,7 @@ fn init_ui(mut commands: Commands) {
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
PlayerState::Pause,
|
|
|
|
PlayerState::Pause,
|
|
|
|
children![Text::new("Go!")],
|
|
|
|
Text::new("PAUSED"),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
commands
|
|
|
|
commands
|
|
|
|
@ -544,26 +544,46 @@ fn init_ui(mut commands: Commands) {
|
|
|
|
align_self: AlignSelf::End,
|
|
|
|
align_self: AlignSelf::End,
|
|
|
|
justify_self: JustifySelf::Center,
|
|
|
|
justify_self: JustifySelf::Center,
|
|
|
|
flex_direction: FlexDirection::Row,
|
|
|
|
flex_direction: FlexDirection::Row,
|
|
|
|
|
|
|
|
justify_content: JustifyContent::SpaceEvenly,
|
|
|
|
|
|
|
|
width: Val::Percent(100.0),
|
|
|
|
|
|
|
|
min_height: Val::Percent(10.0),
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.with_children(|parent| {
|
|
|
|
.with_children(|parent| {
|
|
|
|
parent
|
|
|
|
parent
|
|
|
|
.spawn((
|
|
|
|
.spawn((
|
|
|
|
Node { ..default() },
|
|
|
|
Node {
|
|
|
|
|
|
|
|
width: Val::Percent(50.0),
|
|
|
|
|
|
|
|
align_items: AlignItems::Center,
|
|
|
|
|
|
|
|
justify_content: JustifyContent::Center,
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
},
|
|
|
|
Button,
|
|
|
|
Button,
|
|
|
|
BackgroundColor::default(),
|
|
|
|
BackgroundColor::default(),
|
|
|
|
RewindButton,
|
|
|
|
RewindButton,
|
|
|
|
children![Text::new("Rewind!"),],
|
|
|
|
children![
|
|
|
|
|
|
|
|
Text::new("Rewind!"),
|
|
|
|
|
|
|
|
TextLayout::new_with_justify(JustifyText::Center)
|
|
|
|
|
|
|
|
],
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.observe(start_rewind)
|
|
|
|
.observe(start_rewind)
|
|
|
|
.observe(end_rewind);
|
|
|
|
.observe(end_rewind);
|
|
|
|
|
|
|
|
|
|
|
|
parent
|
|
|
|
parent
|
|
|
|
.spawn((
|
|
|
|
.spawn((
|
|
|
|
Node { ..default() },
|
|
|
|
Node {
|
|
|
|
|
|
|
|
width: Val::Percent(50.0),
|
|
|
|
|
|
|
|
align_items: AlignItems::Center,
|
|
|
|
|
|
|
|
justify_content: JustifyContent::Center,
|
|
|
|
|
|
|
|
..default()
|
|
|
|
|
|
|
|
},
|
|
|
|
Button,
|
|
|
|
Button,
|
|
|
|
FlapButton,
|
|
|
|
FlapButton,
|
|
|
|
children![Text::new("Flap!"),],
|
|
|
|
children![
|
|
|
|
|
|
|
|
Text::new("Flap!"),
|
|
|
|
|
|
|
|
TextFont::from_font_size(30.0),
|
|
|
|
|
|
|
|
TextLayout::new_with_justify(JustifyText::Center)
|
|
|
|
|
|
|
|
],
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.observe(flap_button);
|
|
|
|
.observe(flap_button);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -575,9 +595,11 @@ fn init_ui(mut commands: Commands) {
|
|
|
|
..default()
|
|
|
|
..default()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
BackgroundColor(WHITE.into()),
|
|
|
|
BackgroundColor(WHITE.into()),
|
|
|
|
|
|
|
|
children![(
|
|
|
|
SyncResource::<Score>::default(),
|
|
|
|
SyncResource::<Score>::default(),
|
|
|
|
Text::default(),
|
|
|
|
Text::default(),
|
|
|
|
TextLayout::new_with_justify(JustifyText::Center),
|
|
|
|
TextLayout::new_with_justify(JustifyText::Center),
|
|
|
|
|
|
|
|
)]
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|