pub struct SpriteSheet {
pub sprites: Vec<Sprite>,
pub total_width: u32,
pub total_height: u32,
pub fps: u32,
}
Fields§
§sprites: Vec<Sprite>
§total_width: u32
§total_height: u32
§fps: u32
Implementations§
Source§impl SpriteSheet
impl SpriteSheet
pub fn new(sprites: Vec<Sprite>, total_width: u32, total_height: u32) -> Self
pub fn to_json(&self) -> JsonSpriteSheet
pub fn change_fps(&mut self, fps: u32)
pub fn total_frames(&self) -> usize
pub fn to_css_animation(&self, image_path: PathBuf) -> String
pub fn generate_css(&self, url: &str) -> String
pub fn generate_animation_css(&self) -> String
Trait Implementations§
Source§impl Clone for SpriteSheet
impl Clone for SpriteSheet
Source§fn clone(&self) -> SpriteSheet
fn clone(&self) -> SpriteSheet
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for SpriteSheet
impl RefUnwindSafe for SpriteSheet
impl Send for SpriteSheet
impl Sync for SpriteSheet
impl Unpin for SpriteSheet
impl UnwindSafe for SpriteSheet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more