diff options
Diffstat (limited to 'src/tile.rs')
-rw-r--r-- | src/tile.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tile.rs b/src/tile.rs index d6f5c0e..246308b 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -1,5 +1,5 @@ use ggez::graphics::{spritebatch::SpriteBatch, DrawParam, Rect}; -use ggez::nalgebra::{Point2, Vector2}; +use glam; use std::f32::consts::PI; use xml::reader::XmlEvent; @@ -17,7 +17,7 @@ impl Tile { Tile { source, properties } } - pub fn draw(&self, spritebatch: &mut SpriteBatch, position: Point2<f32>) { + pub fn draw(&self, spritebatch: &mut SpriteBatch, position: glam::Vec2) { let draw = match self.properties.visible { Some(draw) => draw, None => true, @@ -28,9 +28,12 @@ impl Tile { DrawParam::default() .src(self.source) .rotation(self.properties.rotation) - .offset(Point2::new(0.5, 0.5)) + .offset(glam::Vec2::new(0.5, 0.5)) .dest(position) - .scale(Vector2::new(constants::TILE_SCALE, constants::TILE_SCALE)), + .scale(glam::Vec2::new( + constants::TILE_SCALE, + constants::TILE_SCALE, + )), ); } } |