pub fn create_sprite(&self, sprite_name: &str) -> Sprite {
        let width = self.meta.size.w as f32;
        let height = self.meta.size.h as f32;
        let atlas_rect = graphics::Rect::new(0.0, 0.0, width, height);

        if let Some(sprite_data) = self.frames.iter().find(|d| d.filename == sprite_name) {
            Sprite::new(
                graphics::Rect::fraction(
                    sprite_data.frame.x as f32,
                    sprite_data.frame.y as f32,
                    sprite_data.frame.w as f32,
                    sprite_data.frame.h as f32,
                    &atlas_rect,
                ),
                sprite_data.frame.w as f32,
                sprite_data.frame.h as f32,
            )
        } else {
            unimplemented!("Not handling failure to find sprite");
        }
    }
/// Returns a sprite from the Atlas.
Returns a sprite from the Atlas.
Returns a sprite from the Atlas .
pub fn create_sprite(&self, sprite_name: &str) -> Sprite {
        let width = self.meta.size.w as f32;
        let height = self.meta.size.h as f32;
        let atlas_rect = graphics::Rect::new(0.0, 0.0, width, height);
        if let Some(sprite_data) = self.frames.iter().find(|d| d.filename == sprite_name) {
            Sprite::new(
                graphics::Rect::fraction(
                    sprite_data.frame.x as f32,
                    sprite_data.frame.y as f32,
                    sprite_data.frame.w as f32,
                    sprite_data.frame.h as f32,
                    &atlas_rect,
                ),
                sprite_data.frame.w as f32,
                sprite_data.frame.h as f32,
            )
        } else {
            unimplemented!("Not handling failure to find sprite");
        }
    }
pub fn create_sprite ( & self , sprite_name : & str ) -> Sprite { let width = self . meta . size . w as f32 ; let height = self . meta . size . h as f32 ; let atlas_rect = graphics :: Rect :: new ( 0.0 , 0.0 , width , height ) ; if let Some ( sprite_data ) = self . frames . iter ( ) . find ( | d | d . filename == sprite_name ) { Sprite :: new ( graphics :: Rect :: fraction ( sprite_data . frame . x as f32 , sprite_data . frame . y as f32 , sprite_data . frame . w as f32 , sprite_data . frame . h as f32 , & atlas_rect , ) , sprite_data . frame . w as f32 , sprite_data . frame . h as f32 , ) } else { unimplemented ! ( " " ) ; } }
Returns a sprite from the Atlas.
Returns a sprite from the Atlas .
&self
sprite_name
&str
&self
sprite_name
&str