From 4b3da44d65700806f3795baf8928e3050350909c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sat, 9 Mar 2024 14:50:55 +0100 Subject: [PATCH] Adding doc et repair the program --- crates/border-wars/src/lib.rs | 1 + crates/border-wars/src/responsive_scale.rs | 7 +++++++ crates/border-wars/src/scenes/mod.rs | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/border-wars/src/lib.rs b/crates/border-wars/src/lib.rs index a4acdb8..0911f41 100644 --- a/crates/border-wars/src/lib.rs +++ b/crates/border-wars/src/lib.rs @@ -5,6 +5,7 @@ use bevy::prelude::*; pub mod camera; pub mod map; pub mod scenes; +pub mod responsive_scale; /// The current scene of the game. #[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)] diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index 2a501ff..8a322bf 100644 --- a/crates/border-wars/src/responsive_scale.rs +++ b/crates/border-wars/src/responsive_scale.rs @@ -1,4 +1,11 @@ +//! The file that contains the responsive scaling logic. + +use bevy::prelude::*; + +/// The default width of the main node const DEFAULT_WIDTH: f32 = 1280.; + +/// The default height of the main node const DEFAULT_HEIGHT: f32 = 720.; /// Calculates the ui_scale.0 depending on the size of the main node diff --git a/crates/border-wars/src/scenes/mod.rs b/crates/border-wars/src/scenes/mod.rs index dce2e1e..1c6a2b4 100644 --- a/crates/border-wars/src/scenes/mod.rs +++ b/crates/border-wars/src/scenes/mod.rs @@ -3,7 +3,8 @@ use bevy::prelude::*; use bevy_egui::EguiPlugin; -use crate::{change_scaling, CurrentScene}; +use crate::responsive_scale::change_scaling; +use crate::CurrentScene; pub mod lobby; pub mod menu;