Struct bones_render::sprite::AtlasSprite
source · pub struct AtlasSprite {
pub index: usize,
pub atlas: Handle<Atlas>,
pub flip_x: bool,
pub flip_y: bool,
}Expand description
An animated sprite component.
Represents one or more Atlass stacked on top of each other, and possibly animated through a
range of frames out of the atlas.
Fields§
§index: usizeThis is the current index in the animation, with an idx of 0 meaning that the index in
the sprite sheet will be start.
If the idx is greater than end - start, then the animation will loop around.
atlas: Handle<Atlas>The atlas handle.
flip_x: boolWhether or not the flip the sprite horizontally.
flip_y: boolWhether or not the flip the sprite vertically.
Implementations§
source§impl AtlasSprite
impl AtlasSprite
sourcepub fn new(atlas: Handle<Atlas>) -> Self
pub fn new(atlas: Handle<Atlas>) -> Self
Create a new AtlasSprite from the given atlas handle.
Trait Implementations§
source§impl Clone for AtlasSprite
impl Clone for AtlasSprite
source§fn clone(&self) -> AtlasSprite
fn clone(&self) -> AtlasSprite
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for AtlasSprite
impl Debug for AtlasSprite
source§impl Default for AtlasSprite
impl Default for AtlasSprite
source§fn default() -> AtlasSprite
fn default() -> AtlasSprite
Returns the “default value” for a type. Read more