pub struct FixedTweener<Value, Time, T: ?Sized> {
pub delta: Time,
pub tweener: Tweener<Value, Time, T>,
}Expand description
A FixedTweener is a Tweener wrapper which implements Iterator. To do this, it takes a “fixed” delta on its constructor.
§Basic Example
// we provide a tweener which goes from 0 up to 4, in 4 ticks,
// and we progress it by 1 each time we call it.
let (start, end) = (0, 4);
let duration = 4;
let delta = 1;
let mut fixed_tweener = FixedTweener::linear(start, end, duration, delta);
assert_eq!(fixed_tweener.next().unwrap(), 1);
assert_eq!(fixed_tweener.next().unwrap(), 2);
assert_eq!(fixed_tweener.next().unwrap(), 3);
assert_eq!(fixed_tweener.next().unwrap(), 4);
assert_eq!(fixed_tweener.next(), None);§Clamping
FixedTweener, just Tweener, clamps its output, but in its Iterator implementation,
it returns None when it would otherwise clamp!
Therefore, in all cases where a fixed_tweener.is_finished() is true,
fixed_tweener.next().is_none as well.
If you don’t want this behavior, you can instead use move_next(), which clamps.
// a single iteration length tween
let mut fixed_tweener = FixedTweener::linear(0, 1, 1, 1);
// move it to its end...
assert_eq!(fixed_tweener.next().unwrap(), 1);
// and now `.next` returns `None`!
assert!(fixed_tweener.next().is_none());
assert!(fixed_tweener.is_finished());
// but you can still use `move_next`. Note how it returns `Value`, not `Option<Value>`
assert_eq!(fixed_tweener.move_next(), 1);Fields§
§delta: TimeThe delta upon which we move.
tweener: Tweener<Value, Time, T>The internal tweener that we’ve fixed a Delta to.
Implementations§
Source§impl<Value, Time, T> FixedTweener<Value, Time, T>
impl<Value, Time, T> FixedTweener<Value, Time, T>
Sourcepub fn new(
start: Value,
end: Value,
duration: Time,
tween: T,
delta: Time,
) -> Self
pub fn new( start: Value, end: Value, duration: Time, tween: T, delta: Time, ) -> Self
Creates a new FixedTweener out of a Tween, start and end TweenValue, TweenTime duration, and TweenTime delta.
Sourcepub fn new_at(
start: Value,
end: Value,
duration: Time,
tween: T,
current_time: Time,
delta: Time,
) -> Self
pub fn new_at( start: Value, end: Value, duration: Time, tween: T, current_time: Time, delta: Time, ) -> Self
Creates a new FixedTweener out of a Tween, start and end TweenValue, TweenTime duration, and TweenTime current time.
Use this to have “negative” times in Tweeners. This can be useful for starting tweens “with
a delay”. See the example in examples/delayed_tween.rs
Sourcepub fn from_tweener(tweener: Tweener<Value, Time, T>, delta: Time) -> Self
pub fn from_tweener(tweener: Tweener<Value, Time, T>, delta: Time) -> Self
Creates a new FixedTweener, and takes in the delta time it will use per tick.
Source§impl<Value, Time> FixedTweener<Value, Time, Linear>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, Linear>where
Time: TweenTime,
Value: TweenValue,
Source§impl<Value, Time> FixedTweener<Value, Time, CubicIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, CubicIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn cubic_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, CubicIn> ⓘ
pub fn cubic_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, CubicIn> ⓘ
Creates a new CubicIn Tweener.
Sourcepub fn cubic_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, CubicIn>
pub fn cubic_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, CubicIn>
Creates a new CubicIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, CubicOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, CubicOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn cubic_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, CubicOut> ⓘ
pub fn cubic_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, CubicOut> ⓘ
Creates a new CubicOut Tweener.
Sourcepub fn cubic_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, CubicOut>
pub fn cubic_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, CubicOut>
Creates a new CubicOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, CubicInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, CubicInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn cubic_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, CubicInOut> ⓘ
pub fn cubic_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, CubicInOut> ⓘ
Creates a new CubicInOut Tweener.
Sourcepub fn cubic_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, CubicInOut>
pub fn cubic_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, CubicInOut>
Creates a new CubicInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, SineIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, SineIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn sine_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, SineIn> ⓘ
pub fn sine_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, SineIn> ⓘ
Creates a new SineIn Tweener.
Sourcepub fn sine_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, SineIn>
pub fn sine_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, SineIn>
Creates a new SineIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, SineOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, SineOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn sine_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, SineOut> ⓘ
pub fn sine_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, SineOut> ⓘ
Creates a new SineOut Tweener.
Sourcepub fn sine_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, SineOut>
pub fn sine_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, SineOut>
Creates a new SineOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, SineInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, SineInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn sine_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, SineInOut> ⓘ
pub fn sine_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, SineInOut> ⓘ
Creates a new SineOut Tweener.
Sourcepub fn sine_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, SineInOut>
pub fn sine_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, SineInOut>
Creates a new SineOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuintIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuintIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quint_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuintIn> ⓘ
pub fn quint_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuintIn> ⓘ
Creates a new QuintInOut Tweener.
Sourcepub fn quint_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuintIn>
pub fn quint_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuintIn>
Creates a new QuintInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuintOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuintOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quint_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuintOut> ⓘ
pub fn quint_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuintOut> ⓘ
Creates a new QuintOut Tweener.
Sourcepub fn quint_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuintOut>
pub fn quint_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuintOut>
Creates a new QuintOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuintInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuintInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quint_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuintInOut> ⓘ
pub fn quint_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuintInOut> ⓘ
Creates a new QuintInOut Tweener.
Sourcepub fn quint_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuintInOut>
pub fn quint_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuintInOut>
Creates a new QuintInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuadIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuadIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quad_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuadIn> ⓘ
pub fn quad_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuadIn> ⓘ
Creates a new QuadIn Tweener.
Sourcepub fn quad_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuadIn>
pub fn quad_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuadIn>
Creates a new QuadIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuadOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuadOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quad_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuadOut> ⓘ
pub fn quad_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuadOut> ⓘ
Creates a new QuadOut Tweener.
Sourcepub fn quad_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuadOut>
pub fn quad_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuadOut>
Creates a new QuadOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuadInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuadInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quad_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuadInOut> ⓘ
pub fn quad_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuadInOut> ⓘ
Creates a new QuadInOut Tweener.
Sourcepub fn quad_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuadInOut>
pub fn quad_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuadInOut>
Creates a new QuadInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuartIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuartIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quart_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuartIn> ⓘ
pub fn quart_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuartIn> ⓘ
Creates a new QuartIn Tweener.
Sourcepub fn quart_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuartIn>
pub fn quart_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuartIn>
Creates a new QuartIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuartOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuartOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quart_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuartOut> ⓘ
pub fn quart_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuartOut> ⓘ
Creates a new QuartOut Tweener.
Sourcepub fn quart_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuartOut>
pub fn quart_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuartOut>
Creates a new QuartOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, QuartInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, QuartInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn quart_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, QuartInOut> ⓘ
pub fn quart_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, QuartInOut> ⓘ
Creates a new QuartInOut Tweener.
Sourcepub fn quart_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, QuartInOut>
pub fn quart_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, QuartInOut>
Creates a new QuartInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, ExpoIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, ExpoIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn expo_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, ExpoIn> ⓘ
pub fn expo_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, ExpoIn> ⓘ
Creates a new ExpoIn Tweener.
Sourcepub fn expo_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, ExpoIn>
pub fn expo_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, ExpoIn>
Creates a new ExpoIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, ExpoOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, ExpoOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn expo_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, ExpoOut> ⓘ
pub fn expo_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, ExpoOut> ⓘ
Creates a new ExpoOut Tweener.
Sourcepub fn expo_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, ExpoOut>
pub fn expo_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, ExpoOut>
Creates a new ExpoOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, ExpoInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, ExpoInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn expo_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, ExpoInOut> ⓘ
pub fn expo_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, ExpoInOut> ⓘ
Creates a new ExpoInOut Tweener.
Sourcepub fn expo_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, ExpoInOut>
pub fn expo_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, ExpoInOut>
Creates a new ExpoInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, CircIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, CircIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn circ_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, CircIn> ⓘ
pub fn circ_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, CircIn> ⓘ
Creates a new CircIn Tweener.
Sourcepub fn circ_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, CircIn>
pub fn circ_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, CircIn>
Creates a new CircIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, CircOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, CircOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn circ_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, CircOut> ⓘ
pub fn circ_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, CircOut> ⓘ
Creates a new CircOut Tweener.
Sourcepub fn circ_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, CircOut>
pub fn circ_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, CircOut>
Creates a new CircOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, CircInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, CircInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn circ_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, CircInOut> ⓘ
pub fn circ_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, CircInOut> ⓘ
Creates a new CircInOut Tweener.
Sourcepub fn circ_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, CircInOut>
pub fn circ_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, CircInOut>
Creates a new CircInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, BackIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, BackIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn back_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, BackIn> ⓘ
pub fn back_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, BackIn> ⓘ
Creates a new BackIn Tweener.
Sourcepub fn back_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, BackIn>
pub fn back_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, BackIn>
Creates a new BackIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, BackOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, BackOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn back_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, BackOut> ⓘ
pub fn back_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, BackOut> ⓘ
Creates a new BackOut Tweener.
Sourcepub fn back_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, BackOut>
pub fn back_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, BackOut>
Creates a new BackOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, BackInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, BackInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn back_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, BackInOut> ⓘ
pub fn back_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, BackInOut> ⓘ
Creates a new BackInOut Tweener.
Sourcepub fn back_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, BackInOut>
pub fn back_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, BackInOut>
Creates a new BackInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, ElasticIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, ElasticIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn elastic_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, ElasticIn> ⓘ
pub fn elastic_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, ElasticIn> ⓘ
Creates a new ElasticIn Tweener.
Sourcepub fn elastic_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, ElasticIn>
pub fn elastic_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, ElasticIn>
Creates a new ElasticIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, ElasticOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, ElasticOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn elastic_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, ElasticOut> ⓘ
pub fn elastic_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, ElasticOut> ⓘ
Creates a new ElasticOut Tweener.
Sourcepub fn elastic_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, ElasticOut>
pub fn elastic_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, ElasticOut>
Creates a new ElasticOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, ElasticInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, ElasticInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn elastic_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, ElasticInOut> ⓘ
pub fn elastic_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, ElasticInOut> ⓘ
Creates a new ElasticInOut Tweener.
Sourcepub fn elastic_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, ElasticInOut>
pub fn elastic_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, ElasticInOut>
Creates a new ElasticInOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, BounceIn>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, BounceIn>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn bounce_in(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, BounceIn> ⓘ
pub fn bounce_in( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, BounceIn> ⓘ
Creates a new BounceIn Tweener.
Sourcepub fn bounce_in_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, BounceIn>
pub fn bounce_in_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, BounceIn>
Creates a new BounceIn Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, BounceOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, BounceOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn bounce_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, BounceOut> ⓘ
pub fn bounce_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, BounceOut> ⓘ
Creates a new BounceOut Tweener.
Sourcepub fn bounce_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, BounceOut>
pub fn bounce_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, BounceOut>
Creates a new BounceOut Tweener at the given time.
Source§impl<Value, Time> FixedTweener<Value, Time, BounceInOut>where
Time: TweenTime,
Value: TweenValue,
impl<Value, Time> FixedTweener<Value, Time, BounceInOut>where
Time: TweenTime,
Value: TweenValue,
Sourcepub fn bounce_in_out(
start: Value,
end: Value,
duration: Time,
delta: Time,
) -> FixedTweener<Value, Time, BounceInOut> ⓘ
pub fn bounce_in_out( start: Value, end: Value, duration: Time, delta: Time, ) -> FixedTweener<Value, Time, BounceInOut> ⓘ
Creates a new BounceInOut Tweener.
Sourcepub fn bounce_in_out_at(
start: Value,
end: Value,
duration: Time,
current_time: Time,
) -> Tweener<Value, Time, BounceInOut>
pub fn bounce_in_out_at( start: Value, end: Value, duration: Time, current_time: Time, ) -> Tweener<Value, Time, BounceInOut>
Creates a new BounceInOut Tweener at the given time.
Methods from Deref<Target = Tweener<Value, Time, T>>§
Sourcepub fn move_to(&mut self, position: Time) -> Value
pub fn move_to(&mut self, position: Time) -> Value
Moves the tween to a given Time. If this Tween previously was outside
0..=1 in parametric (percentage) space, ie. outside the duration of the tween or in
negative time, this can move it back into bounds.
Giving TweenTime::ZERO to this function effectively resets a tweener.
Giving a negative time or a time beyond duration will move the tween there, but we will
always clamp the output time.
Sourcepub fn move_by(&mut self, delta: Time) -> Value
pub fn move_by(&mut self, delta: Time) -> Value
Drives the Tweener forward X steps in time.
If an input higher than the tween’s duration is given, you will
receive the max value of the tween.
Sourcepub fn initial_value(&self) -> Value
pub fn initial_value(&self) -> Value
The initial value a tween was set to start at.
Sourcepub fn final_value(&self) -> Value
pub fn final_value(&self) -> Value
The final value the tween should end at.
Sourcepub fn is_started(&self) -> bool
pub fn is_started(&self) -> bool
Returns true is the Tweener’s current_time is greater than or equal to 0. Only
negative times will return false.
Note that for tweens without bounds (infinite tweens like Looper), this method will always
return true. Moreover, this method does not check if a tweener is finished. For
that, use is_finished.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true is the Tweener’s current_time is greater than or equal to duration.
Note that for tweens without bounds (infinite tweens like Looper), this method will always
return false. Moreover, this method does not check if a tweener is started. For
that, use is_started.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true is the Tweener’s current_time is greater than or equal to 0 but less than
duration.
Note that for tweens without bounds (infinite tweens like Looper), this method will always
return true.
This method is rarely needed – only use it if you are doing some second-order tweening.
Sourcepub fn current_time_state(&self) -> CurrentTimeState
pub fn current_time_state(&self) -> CurrentTimeState
Returns CurrentTimeState based on the Tweener’s current_time.
Note that for tweens without bounds (in this library, Looper, Oscillator, and
Extrapolator), this method will always return CurrentTimeState::Valid.
Trait Implementations§
Source§impl<Value: Clone, Time: Clone, T: Clone + ?Sized> Clone for FixedTweener<Value, Time, T>
impl<Value: Clone, Time: Clone, T: Clone + ?Sized> Clone for FixedTweener<Value, Time, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Value, Time, T> Deref for FixedTweener<Value, Time, T>
impl<Value, Time, T> Deref for FixedTweener<Value, Time, T>
Source§impl<Value, Time, T> DerefMut for FixedTweener<Value, Time, T>
impl<Value, Time, T> DerefMut for FixedTweener<Value, Time, T>
Source§impl<Value, Time, T> Iterator for FixedTweener<Value, Time, T>
impl<Value, Time, T> Iterator for FixedTweener<Value, Time, T>
Source§fn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
Source§fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
iter_next_chunk)N values. Read more1.0.0 · Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
1.0.0 · Source§fn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
Self: Sized,
fn last(self) -> Option<Self::Item>where
Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by)n elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
nth element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse)separator between adjacent
items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse)separator
between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n elements, or fewer
if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows)f for each contiguous window of size N over
self and returns an iterator over the outputs of f. Like slice::windows(),
the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Iterator. Read moreSource§fn try_collect<B>(
&mut self,
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( &mut self, ) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned)true precede all those that return false. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
&mut self,
f: impl FnMut(Self::Item, Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( &mut self, f: impl FnMut(Self::Item, Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
&mut self,
f: impl FnMut(&Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( &mut self, f: impl FnMut(&Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
iter_array_chunks)N elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
iter_order_by)Iterator with those
of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
PartialOrd elements of
this Iterator with those of another. The comparison works like short-circuit
evaluation, returning a result without comparing the remaining elements.
As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by)Iterator with those
of another with respect to the specified comparison function. Read moreSource§fn eq_by<I, F>(self, other: I, eq: F) -> bool
fn eq_by<I, F>(self, other: I, eq: F) -> bool
iter_order_by)1.5.0 · Source§fn lt<I>(self, other: I) -> bool
fn lt<I>(self, other: I) -> bool
Iterator are lexicographically
less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> bool
fn le<I>(self, other: I) -> bool
Iterator are lexicographically
less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> bool
fn gt<I>(self, other: I) -> bool
Iterator are lexicographically
greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> bool
fn ge<I>(self, other: I) -> bool
Iterator are lexicographically
greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
Source§impl<Value: Ord, Time: Ord, T: Ord + ?Sized> Ord for FixedTweener<Value, Time, T>
impl<Value: Ord, Time: Ord, T: Ord + ?Sized> Ord for FixedTweener<Value, Time, T>
Source§fn cmp(&self, other: &FixedTweener<Value, Time, T>) -> Ordering
fn cmp(&self, other: &FixedTweener<Value, Time, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<Value: PartialEq, Time: PartialEq, T: PartialEq + ?Sized> PartialEq for FixedTweener<Value, Time, T>
impl<Value: PartialEq, Time: PartialEq, T: PartialEq + ?Sized> PartialEq for FixedTweener<Value, Time, T>
Source§fn eq(&self, other: &FixedTweener<Value, Time, T>) -> bool
fn eq(&self, other: &FixedTweener<Value, Time, T>) -> bool
self and other values to be equal, and is used by ==.