[][src]Struct silver_animation::LinearConfig

pub struct LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: Fn(&mut T, usize, &mut Graphics, Rectangle) -> Result<()>,
    MaxFrames: Fn(&T) -> usize
{ pub begin_state: T, pub timing: Timer, pub draw: DrawFunc, pub max_frames: MaxFrames, }

A more advanced animation than SimpleLinearConfig. It follows the same idea however you are in full control over what is used to draw images and how they are drawn.

Fields

begin_state: T

Data needed to draw the animation. This can be mutated during draw calls if needed.

timing: Timer

Controls how fast the animation plays.

draw: DrawFunc

The function that will actuall draw the current animation frame.

max_frames: MaxFrames

How many frames the animation has before it loops.

Implementations

impl<T, DrawFunc, MaxFrames> LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: Fn(&mut T, usize, &mut Graphics, Rectangle) -> Result<()>,
    MaxFrames: Fn(&T) -> usize
[src]

pub fn into_animation(self) -> Linear<T, DrawFunc, MaxFrames>[src]

Turn the config into an actual animation.

Auto Trait Implementations

impl<T, DrawFunc, MaxFrames> RefUnwindSafe for LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: RefUnwindSafe,
    MaxFrames: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, DrawFunc, MaxFrames> Send for LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: Send,
    MaxFrames: Send,
    T: Send

impl<T, DrawFunc, MaxFrames> Sync for LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: Sync,
    MaxFrames: Sync,
    T: Sync

impl<T, DrawFunc, MaxFrames> Unpin for LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: Unpin,
    MaxFrames: Unpin,
    T: Unpin

impl<T, DrawFunc, MaxFrames> UnwindSafe for LinearConfig<T, DrawFunc, MaxFrames> where
    DrawFunc: UnwindSafe,
    MaxFrames: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.