From 3286af8a5bed6ac19f614cb2bf9ee0f5ef6b2bbd Mon Sep 17 00:00:00 2001 From: Frank Mayer Date: Tue, 2 Jul 2024 15:09:47 +0200 Subject: [PATCH] fix camera scaling --- src/cam.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cam.rs b/src/cam.rs index 4c34405..3f43e44 100644 --- a/src/cam.rs +++ b/src/cam.rs @@ -17,9 +17,14 @@ */ use bevy::prelude::*; +use bevy::render::camera::ScalingMode; fn add_camera(mut commands: Commands) { - commands.spawn(Camera2dBundle::default()); + let mut my_2d_camera_bundle = Camera2dBundle::default(); + my_2d_camera_bundle.projection.scaling_mode = ScalingMode::FixedVertical(1600.0); + my_2d_camera_bundle.transform = Transform::from_xyz(0.0, 0.0, 0.0); + + commands.spawn(my_2d_camera_bundle); } pub struct CamPlugin;