pub struct Animation {
pub frame_width: u32,
pub frame_height: u32,
pub frames: Vec<AnimationFrame>,
pub interpolate: bool,
}Expand description
A texture’s animation (.png.mcmeta), as the game plays it: frames
frame_width×frame_height laid row by row over the image, shown in
frames order, each for its time in ticks.
Fields§
§frame_width: u32§frame_height: u32§frames: Vec<AnimationFrame>§interpolate: boolBlends each frame into the next (the game’s interpolate).
Implementations§
Source§impl Animation
impl Animation
Sourcepub fn read(meta: &str, size: (u32, u32)) -> Option<Animation>
pub fn read(meta: &str, size: (u32, u32)) -> Option<Animation>
The animation of a size image from its .mcmeta text; None when it has none.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Animation
impl<'de> Deserialize<'de> for Animation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Animation
Auto Trait Implementations§
impl Freeze for Animation
impl RefUnwindSafe for Animation
impl Send for Animation
impl Sync for Animation
impl Unpin for Animation
impl UnsafeUnpin for Animation
impl UnwindSafe for Animation
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