summaryrefslogtreecommitdiff
path: root/src/animations.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/animations.rs')
-rw-r--r--src/animations.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/animations.rs b/src/animations.rs
index 43f4326..58b6bf2 100644
--- a/src/animations.rs
+++ b/src/animations.rs
@@ -43,14 +43,16 @@ impl Animation {
}
pub fn draw(&self, spritebatch: &mut SpriteBatch, position: Point2<f32>) {
- spritebatch.add(
- DrawParam::default()
- .src(self.current.source)
- .rotation(self.current.properties.rotation)
- .offset(Point2::new(0.5, 0.5))
- .dest(position)
- .scale(Vector2::new(constants::TILE_SCALE, constants::TILE_SCALE)),
- );
+ if self.current.properties.visible.is_none() {
+ spritebatch.add(
+ DrawParam::default()
+ .src(self.current.source)
+ .rotation(self.current.properties.rotation)
+ .offset(Point2::new(0.5, 0.5))
+ .dest(position)
+ .scale(Vector2::new(constants::TILE_SCALE, constants::TILE_SCALE)),
+ );
+ }
}
}