diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-04-08 13:19:15 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-04-08 13:20:24 +0200 |
commit | d39c819000569b468cfa68977f8a8b03062ac5d9 (patch) | |
tree | af6d85a04080a2027591dcd6388822c24bd38dcf /src/client.rs | |
parent | 6471203be63bb5dd7716aa9841014f7e9105d452 (diff) |
feat: add `--scale-factor` option
Diffstat (limited to 'src/client.rs')
-rw-r--r-- | src/client.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs index d111732..b71b83c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -19,6 +19,7 @@ use bevy::input::keyboard::*; use bevy::input::mouse::MouseButton; use bevy::prelude::*; use bevy::sprite::{MaterialMesh2dBundle, Mesh2dHandle}; +use bevy::window::*; use lightyear::client::connection::ConnectionManager; use lightyear::client::events::*; use lightyear::prelude::client::ClientConnection; @@ -34,9 +35,16 @@ pub fn main( transport: TransportConfig, champion: Champion, faction: Faction, + scale_factor: f32, ) { App::new() - .add_plugins(DefaultPlugins) + .add_plugins(DefaultPlugins.set(WindowPlugin { + primary_window: Some(Window { + resolution: WindowResolution::default().with_scale_factor_override(scale_factor), + ..Default::default() + }), + ..Default::default() + })) .add_plugins(ClientPlugin { server_addr, client_id, |