[−][src]Struct termi_graphics::animation::Animation
animation struct is used to connect between different screens and run them in a fixed speed.
Methods
impl Animation
[src]
pub fn new(roll: Vec<Screen>, fps: u8, length: u8) -> Animation
[src]
defines a new animation #Examples
use termi_graphics::pixel_art::{Screen,PixelColors}; use termi_graphics::animation::Animation; let screen1 = Screen::new(25,25,PixelColors::Red).unwrap(); let screen2 = Screen::new(25,25,PixelColors::Red).unwrap(); let screen3 = Screen::new(25,25,PixelColors::Red).unwrap(); let anim = Animation::new(vec![screen1,screen2,screen3],15,10);
creates a new animation made of 3 reoccuring screen running at 15 fps for 10 seconds.
pub fn play(&self)
[src]
starts the animation #Examples
use termi_graphics::pixel_art::{Screen,PixelColors}; use termi_graphics::animation::Animation; let screen1 = Screen::new(25,25,PixelColors::Red).unwrap(); let screen2 = Screen::new(25,25,PixelColors::Red).unwrap(); let screen3 = Screen::new(25,25,PixelColors::Red).unwrap(); let anim = Animation::new(vec![screen1,screen2,screen3],15,10); anim.play();
running the 3 screen one after the other in rate of 15 screens per sec, for 10 seconds, then stops.
pub fn pause(&self)
[src]
stops animation doesn't work well just yet - making threadpools in upcoming changes #Examples
use termi_graphics::pixel_art::{Screen,PixelColors}; use termi_graphics::animation::Animation; let screen1 = Screen::new(25,25,PixelColors::Red).unwrap(); let screen2 = Screen::new(25,25,PixelColors::Red).unwrap(); let screen3 = Screen::new(25,25,PixelColors::Red).unwrap(); let anim = Animation::new(vec![screen1,screen2,screen3],15,10); anim.play(); anim.pause();
Auto Trait Implementations
impl Send for Animation
impl Unpin for Animation
impl Sync for Animation
impl UnwindSafe for Animation
impl RefUnwindSafe for Animation
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,