diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-06-12 14:28:10 +0200 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-06-12 14:28:10 +0200 |
commit | cd08f79d84411d6f4dff8a18ab79b363963f01b8 (patch) | |
tree | 56efacf23349cfb2ee22adf40ed2cd74e22082f3 /src |
fresh
Diffstat (limited to 'src')
-rw-r--r-- | src/debug.rs | 12 | ||||
-rw-r--r-- | src/main.rs | 19 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/debug.rs b/src/debug.rs new file mode 100644 index 0000000..4036ced --- /dev/null +++ b/src/debug.rs @@ -0,0 +1,12 @@ +use bevy::prelude::*; +use bevy_inspector_egui::{RegisterInspectable, WorldInspectorPlugin}; + +pub struct DebugPlugin; + +impl Plugin for DebugPlugin { + fn build(&self, app: &mut App) { + if cfg!(debug_assertions) { + app.add_plugin(WorldInspectorPlugin::new()); + } + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..183ac42 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,19 @@ +use bevy::{prelude::*, render::camera::ScalingMode}; + +mod debug; + +use debug::DebugPlugin; + +fn main() { + App::new() + .add_plugins(DefaultPlugins) + .add_plugin(DebugPlugin) + .add_startup_system(spawn_camera) + .run(); +} + +fn spawn_camera(mut commands: Commands) { + let mut camera = OrthographicCameraBundle::new_2d(); + camera.orthographic_projection.scaling_mode = ScalingMode::None; + commands.spawn_bundle(camera); +} |