diff options
Diffstat (limited to 'src/camera.rs')
-rw-r--r-- | src/camera.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/camera.rs b/src/camera.rs index bcb8f69..3461df1 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -1,10 +1,10 @@ use ggez::conf::Conf; -use ggez::nalgebra::Point2; +use glam::*; use crate::constants; pub struct Camera { - pub draw: Point2<f32>, + pub draw: glam::Vec2, window_dimensions: (f32, f32), map_dimensions: (f32, f32), } @@ -13,13 +13,13 @@ impl Camera { pub fn new(map_dimensions: (f32, f32)) -> Camera { let conf = Conf::new(); Camera { - draw: Point2::new(0.0, 0.0), + draw: glam::Vec2::new(0.0, 0.0), window_dimensions: (conf.window_mode.width, conf.window_mode.height), map_dimensions, } } - pub fn give_center(&mut self, center: Point2<f32>) { + pub fn give_center(&mut self, center: glam::Vec2) { self.draw.x = ((self.window_dimensions.0 / 2.0) - center.x) - (constants::TILE_WIDTH); self.draw.y = ((self.window_dimensions.1 / 2.0) - center.y) - (constants::TILE_HEIGHT); |