diff --git a/src/camera.rs b/src/camera.rs index 2314413c..85e2ca9d 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -1,9 +1,10 @@ use bevy::{ core::Time, input::Input, + math::Vec2, prelude::{ - Camera, EventWriter, KeyCode, OrthographicProjection, Query, Res, ResMut, Transform, With, - Without, + Camera, Component, EventWriter, KeyCode, OrthographicProjection, Query, Res, ResMut, + Transform, With, Without, }, render::camera::CameraProjection, window::Windows, @@ -12,31 +13,32 @@ use bevy_parallax::ParallaxMoveEvent; use crate::{consts, Player}; +#[derive(Component)] +pub struct Panning { + pub offset: Vec2, +} + pub fn helper_camera_controller( - mut query: Query<(&mut Camera, &mut OrthographicProjection, &mut Transform)>, + mut query: Query<(&mut Camera, &mut OrthographicProjection, &mut Panning)>, keys: Res>, time: Res