aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.rs10
-rw-r--r--src/main.rs4
2 files changed, 13 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,
diff --git a/src/main.rs b/src/main.rs
index 210909b..4852856 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -24,6 +24,8 @@ struct Cli {
champion: Champion,
#[arg(long, default_value = "yellow")]
faction: Faction,
+ #[arg(long, default_value = "1.0")]
+ scale_factor: f32,
}
fn main() {
@@ -47,6 +49,7 @@ fn main() {
TransportConfig::UdpSocket(client_addr),
cli.champion,
cli.faction,
+ cli.scale_factor,
);
} else {
let (from_server_send, from_server_recv) = crossbeam_channel::unbounded();
@@ -68,6 +71,7 @@ fn main() {
},
cli.champion,
cli.faction,
+ cli.scale_factor,
);
}
}