From cd08f79d84411d6f4dff8a18ab79b363963f01b8 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sun, 12 Jun 2022 14:28:10 +0200 Subject: fresh --- src/debug.rs | 12 ++++++++++++ src/main.rs | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/debug.rs create mode 100644 src/main.rs (limited to 'src') 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); +} -- cgit v1.2.3-54-g00ecf