aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-04-08 13:19:15 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-04-08 13:20:24 +0200
commitd39c819000569b468cfa68977f8a8b03062ac5d9 (patch)
treeaf6d85a04080a2027591dcd6388822c24bd38dcf /src/client.rs
parent6471203be63bb5dd7716aa9841014f7e9105d452 (diff)
feat: add `--scale-factor` option
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs10
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,