parent
f638218463
commit
55e4ee7b6b
7 changed files with 4327 additions and 8 deletions
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 39 KiB |
@ -1,3 +1,29 @@ |
|||||||
fn main() { |
use bevy::{prelude::*, window::WindowResolution}; |
||||||
println!("Hello, client!"); |
|
||||||
|
fn main() -> AppExit { |
||||||
|
App::new() |
||||||
|
.add_plugins(DefaultPlugins.set(WindowPlugin { |
||||||
|
primary_window: Some(Window { |
||||||
|
title: "gæmstone Client".into(), |
||||||
|
// Steam Deck: DPI appears pretty high, causing everything to be scaled up.
|
||||||
|
// Setting scale factor override prevents this from happening.
|
||||||
|
resolution: WindowResolution::new(1280., 720.).with_scale_factor_override(1.0), |
||||||
|
// WASM: Fit canvas to parent element, so `Window` resizes automatically.
|
||||||
|
fit_canvas_to_parent: true, |
||||||
|
// WASM: Don't override default event handling like browser hotkeys while focused.
|
||||||
|
prevent_default_event_handling: false, |
||||||
|
..default() |
||||||
|
}), |
||||||
|
..default() |
||||||
|
})) |
||||||
|
.add_systems(Startup, setup) |
||||||
|
.run() |
||||||
|
} |
||||||
|
|
||||||
|
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) { |
||||||
|
commands.spawn(Camera2dBundle::default()); |
||||||
|
commands.spawn(SpriteBundle { |
||||||
|
texture: asset_server.load("heck.png"), |
||||||
|
..default() |
||||||
|
}); |
||||||
} |
} |
||||||
|
@ -1,3 +1,12 @@ |
|||||||
fn main() { |
use bevy::{log::LogPlugin, prelude::*}; |
||||||
println!("Hello, server!"); |
|
||||||
|
fn main() -> AppExit { |
||||||
|
App::new() |
||||||
|
.add_plugins((LogPlugin::default(), MinimalPlugins)) |
||||||
|
.add_systems(Startup, setup) |
||||||
|
.run() |
||||||
|
} |
||||||
|
|
||||||
|
fn setup() { |
||||||
|
info!("Hello from gæmstone server!"); |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue