pub enum Animation {
Show 16 variants
MoveTo(f64, Scalar, Scalar),
MoveBy(f64, Scalar, Scalar),
RotateTo(f64, Scalar),
RotateBy(f64, Scalar),
ScaleTo(f64, Scalar, Scalar),
ScaleBy(f64, Scalar, Scalar),
FlipX(bool),
FlipY(bool),
Show,
Hide,
ToggleVisibility,
Blink(f64, usize),
FadeIn(f64),
FadeOut(f64),
FadeTo(f64, f64),
Ease(EaseFunction, Box<Animation>),
}
Expand description
Animations supported by Sprite
Variants
MoveTo(f64, Scalar, Scalar)
duration, x, y
Move sprite to specified position
MoveBy(f64, Scalar, Scalar)
duration, x, y
Move sprite to specified position, relatively
RotateTo(f64, Scalar)
duration, deg
Rotate sprite to specified degree
RotateBy(f64, Scalar)
duration, deg
Rotate sprite to specified degree, relatively
ScaleTo(f64, Scalar, Scalar)
duration, sx, sy
Scale sprite to specified scale
ScaleBy(f64, Scalar, Scalar)
duration, sx, sy
Scale sprite to specified scale, relatively
FlipX(bool)
Flip sprite in x direction
FlipY(bool)
Flip sprite in y direction
Show
Set the sprite’s visibility to true
Hide
Set the sprite’s visibility to false
ToggleVisibility
Toggle the sprite’s visibility
Blink(f64, usize)
duration, times
FadeIn(f64)
duration
Fade in the sprite, set its opacity from 0 to 1 in dt
seconds
FadeOut(f64)
duration
Fade out the sprite, set its opacity from 1 to 0 in dt
seconds
FadeTo(f64, f64)
duration, opacity
Set the sprite’s opacity to specified value in dt
seconds
Ease(EaseFunction, Box<Animation>)
ease_function, animation
Tweening the animation with ease function
Implementations
sourceimpl Animation
impl Animation
sourcepub fn to_state<I: ImageSize>(&self, sprite: &Sprite<I>) -> AnimationState
pub fn to_state<I: ImageSize>(&self, sprite: &Sprite<I>) -> AnimationState
Generate a new state from Animation with specified Sprite
Trait Implementations
impl StructuralPartialEq for Animation
Auto Trait Implementations
impl RefUnwindSafe for Animation
impl Send for Animation
impl Sync for Animation
impl Unpin for Animation
impl UnwindSafe for Animation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more