Struct tween::FixedTweener
source · 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: Time
The 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, 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>
n
th 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_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>
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,
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<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<F, R>( &mut self, f: F ) -> <<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<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<F, R>( &mut self, f: F ) -> <<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.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 moresource§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
is_sorted
)source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
is_sorted
)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 ==
.source§impl<Value: PartialOrd, Time: PartialOrd, T: PartialOrd + ?Sized> PartialOrd for FixedTweener<Value, Time, T>
impl<Value: PartialOrd, Time: PartialOrd, T: PartialOrd + ?Sized> PartialOrd for FixedTweener<Value, Time, T>
source§fn partial_cmp(&self, other: &FixedTweener<Value, Time, T>) -> Option<Ordering>
fn partial_cmp(&self, other: &FixedTweener<Value, Time, T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more