pub struct Anim {
pub id: u8,
pub group: u8,
pub fps: u8,
pub len: u8,
pub tileset: u8,
pub palette: u8,
pub frames: [Frame; 6],
}
Expand description
A collection of frames representing a single action animation (i.e. Idle, Run, etc.). To provide multiple anims to an entity, simply store multiple Anim structs somewhere and assign one of them to the entity.
Fields§
§id: u8
§group: u8
§fps: u8
§len: u8
§tileset: u8
§palette: u8
§frames: [Frame; 6]
Implementations§
source§impl Anim
impl Anim
pub fn id(&self) -> u8
pub fn len(&self) -> u8
pub fn is_empty(&self) -> bool
pub fn frames(&self) -> &[Frame]
pub fn serialize(&self) -> [u8; 234]
pub fn deserialize(cursor: &mut Cursor<'_, u8>) -> Self
pub fn frame(&self, time: f32) -> &Frame
pub fn current_frame_number(&self, time: f32) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Anim
impl RefUnwindSafe for Anim
impl Send for Anim
impl Sync for Anim
impl Unpin for Anim
impl UnwindSafe for Anim
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