generated from tipragot/rust
Add a responsive scaling for ui #73
|
@ -5,6 +5,7 @@ use bevy::prelude::*;
|
||||||
pub mod camera;
|
pub mod camera;
|
||||||
pub mod map;
|
pub mod map;
|
||||||
pub mod scenes;
|
pub mod scenes;
|
||||||
|
pub mod responsive_scale;
|
||||||
|
|
||||||
/// The current scene of the game.
|
/// The current scene of the game.
|
||||||
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]
|
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]
|
||||||
|
|
|
@ -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.;
|
const DEFAULT_WIDTH: f32 = 1280.;
|
||||||
|
|
||||||
|
/// The default height of the main node
|
||||||
const DEFAULT_HEIGHT: f32 = 720.;
|
const DEFAULT_HEIGHT: f32 = 720.;
|
||||||
|
|||||||
|
|
||||||
/// Calculates the ui_scale.0 depending on the size of the main node
|
/// Calculates the ui_scale.0 depending on the size of the main node
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_egui::EguiPlugin;
|
use bevy_egui::EguiPlugin;
|
||||||
|
|
||||||
use crate::{change_scaling, CurrentScene};
|
use crate::responsive_scale::change_scaling;
|
||||||
|
use crate::CurrentScene;
|
||||||
|
|
||||||
pub mod lobby;
|
pub mod lobby;
|
||||||
pub mod menu;
|
pub mod menu;
|
||||||
|
|
Loading…
Reference in a new issue
You should put these constants in bevy's resources instead.
this can be changed in future settings.