diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index 8f925f3..1295893 100644 --- a/crates/border-wars/src/responsive_scale.rs +++ b/crates/border-wars/src/responsive_scale.rs @@ -10,8 +10,8 @@ const DEFAULT_HEIGHT: f32 = 720.; /// Calculates the ui_scale.0 depending on the default screen size /// in order to make the screen responsive -pub fn change_scaling(mut ui_scale: ResMut, window: Query<&Window>) { - let window = window.single(); +pub fn change_scaling(mut ui_scale: ResMut, windows: Query<&Window>) { + let window = windows.get_single().expect("Main window not found"); let (a, b) = ( window.resolution.width() / DEFAULT_WIDTH, window.resolution.height() / DEFAULT_HEIGHT,