From 7d59cd2510ac926edd0790de4bffb0fbb9c60e7c Mon Sep 17 00:00:00 2001 From: tom barrett Date: Fri, 28 Jun 2019 10:05:13 -0500 Subject: animation working --- src/tileset.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tileset.rs') diff --git a/src/tileset.rs b/src/tileset.rs index eb097e5..45d68a3 100644 --- a/src/tileset.rs +++ b/src/tileset.rs @@ -81,13 +81,13 @@ impl Tileset { } } - pub fn get_rect_by_entity(&self, entity: &str) -> Rect { + pub fn get_tile_by_entity_keyframe(&self, entity: &str, keyframe: usize) -> Rect { *self .tiles .get( self.properties .iter() - .find(|(_, p)| p.entity == entity && 0 == p.keyframe) + .find(|(_, p)| p.entity == entity && keyframe == p.keyframe) .unwrap() .0, ) -- cgit v1.2.3