From ceb3eff116f9ddf8dcb71a0a77efb63531f75ab2 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 2 Feb 2022 19:08:44 +0100 Subject: 2022 update --- src/tile.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/tile.rs') 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) { + 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, + )), ); } } -- cgit v1.2.3