prototypes/life: the buttons all do things!

main
Elijah Voigt 1 month ago
parent 53aaf8963a
commit 73246ed035

@ -161,11 +161,25 @@ fn setup(mut commands: Commands) {
fn play_sim(_trigger: On<Pointer<Press>>, mut next: ResMut<NextState<SimulationState>>) {
next.set(SimulationState::Run);
}
fn zoom_out(trigger: On<Pointer<Press>>) {
todo!()
fn zoom_out(trigger: On<Pointer<Press>>, mut projection: Query<&mut Projection>) {
projection.iter_mut().for_each(|mut p| {
match *p {
Projection::Orthographic(ref mut o) => {
o.scale /= 0.5;
}
_ => todo!()
}
});
}
fn zoom_in(trigger: On<Pointer<Press>>) {
todo!()
fn zoom_in(trigger: On<Pointer<Press>>, mut projection: Query<&mut Projection>) {
projection.iter_mut().for_each(|mut p| {
match *p {
Projection::Orthographic(ref mut o) => {
o.scale *= 0.5;
}
_ => todo!()
}
});
}
// Spawn Coordiantes
@ -458,3 +472,7 @@ fn cooldown_secs(input: f32) -> impl FnMut(Local<Timer>, Res<Time>) -> bool + Cl
}
}
// If in Run state, keep Run button light, or blinking or outlined or something.
// If in Pause state, keep Pauses button light, or blinking or outlined or something.
// TODO: How to get infinite tiling background...

Loading…
Cancel
Save