summaryrefslogtreecommitdiff
path: root/src/tile.rs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2022-02-02 19:08:44 +0100
committerTom Barrett <tom@tombarrett.xyz>2022-02-02 19:08:44 +0100
commitceb3eff116f9ddf8dcb71a0a77efb63531f75ab2 (patch)
treec818ad7241797fa72e0cb802f09c9a1b296e1fb0 /src/tile.rs
parent8cdbe7352c4846eb339358bcca6083f747e27721 (diff)
2022 updateHEADmaster
Diffstat (limited to 'src/tile.rs')
-rw-r--r--src/tile.rs11
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,
+ )),
);
}
}