pub enum Ease {
Show 25 variants
Linear,
SineIn,
SineOut,
SineInOut,
QuadIn,
QuadOut,
QuadInOut,
CubicIn,
CubicOut,
CubicInOut,
QuartIn,
QuartOut,
QuartInOut,
ExpoIn,
ExpoOut,
ExpoInOut,
BackIn,
BackOut,
BackInOut,
ElasticIn,
ElasticOut,
ElasticInOut,
BounceIn,
BounceOut,
BounceInOut,
}Expand description
Standard easing curves. Ease::apply maps t in [0, 1] (clamped) to
eased progress with exact endpoints 0 → 0 and 1 → 1. Back and elastic
curves overshoot outside [0, 1] in between; bounce stays inside it.
use ferravex_play::tween::Ease;
for ease in Ease::ALL {
assert_eq!((ease.apply(0.), ease.apply(1.)), (0., 1.));
}
assert!(Ease::QuadIn.apply(0.5) < 0.5 && Ease::QuadOut.apply(0.5) > 0.5);
assert!(Ease::BackOut.apply(0.7) > 1.); // overshootVariants§
Linear
SineIn
SineOut
SineInOut
QuadIn
QuadOut
QuadInOut
CubicIn
CubicOut
CubicInOut
QuartIn
QuartOut
QuartInOut
ExpoIn
ExpoOut
ExpoInOut
BackIn
BackOut
BackInOut
ElasticIn
ElasticOut
ElasticInOut
BounceIn
BounceOut
BounceInOut
Implementations§
Trait Implementations§
impl Copy for Ease
impl Eq for Ease
impl StructuralPartialEq for Ease
Auto Trait Implementations§
impl Freeze for Ease
impl RefUnwindSafe for Ease
impl Send for Ease
impl Sync for Ease
impl Unpin for Ease
impl UnwindSafe for Ease
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