fn change_scale_factor(input: Res<Input<KeyCode>>, mut windows: ResMut<Windows>) {
    let window = windows.get_primary_mut().unwrap();
    if input.just_pressed(KeyCode::Up) {
        window.set_scale_factor_override(window.scale_factor_override().map(|n| n + 1.));
    } else if input.just_pressed(KeyCode::Down) {
        window.set_scale_factor_override(window.scale_factor_override().map(|n| (n - 1.).max(1.)));
    }
}
/// This system changes the scale factor override when up or down is pressed
This system changes the scale factor override when up or down is pressed
This system changes the scale factor override when up or down is pressed
fn change_scale_factor(input: Res<Input<KeyCode>>, mut windows: ResMut<Windows>) {
    let window = windows.get_primary_mut().unwrap();
    if input.just_pressed(KeyCode::Up) {
        window.set_scale_factor_override(window.scale_factor_override().map(|n| n + 1.));
    } else if input.just_pressed(KeyCode::Down) {
        window.set_scale_factor_override(window.scale_factor_override().map(|n| (n - 1.).max(1.)));
    }
}
fn change_scale_factor ( input : Res < Input < KeyCode > > , mut windows : ResMut < Windows > ) { let window = windows . get_primary_mut ( ) . unwrap ( ) ; if input . just_pressed ( KeyCode :: Up ) { window . set_scale_factor_override ( window . scale_factor_override ( ) . map ( | n | n + 1. ) ) ; } else if input . just_pressed ( KeyCode :: Down ) { window . set_scale_factor_override ( window . scale_factor_override ( ) . map ( | n | ( n - 1. ) . max ( 1. ) ) ) ; } }
This system changes the scale factor override when up or down is pressed
This system changes the scale factor override when up or down is pressed
input
Res<Input<KeyCode>>
windows
ResMut<Windows>
input
Res<Input<KeyCode>>
windows
ResMut<Windows>