pub trait Tween<Value> {
// Required method
fn tween(&mut self, value_delta: Value, percent: f32) -> Value;
// Provided method
fn is_finite(&self) -> bool { ... }
}
Expand description
This is the core trait of the Library, which all tweens implement.
Required Methods§
Provided Methods§
sourcefn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which which are both unbounded (because they never stop returning values), and Extrapolator, which simply unbounds tweens.
This is used by Tweener and FixedTweener to determine when to clamp and when a tween will return true for Tweener::is_finished.
If you have a Tween which returns valid values at all percentage ranges at all times, you should return false.
If you would like to extrapolate a tween beyond its bounds, you can wrap it in Extrapolator.
Trait Implementations§
source§impl<'a, Value> Tween<Value> for &'a mut dyn Tween<Value>where
Value: TweenValue,
impl<'a, Value> Tween<Value> for &'a mut dyn Tween<Value>where
Value: TweenValue,
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value>>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value>>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send + Sync>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send + Sync>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send + Sync + Unpin>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send + Sync + Unpin>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send + Unpin>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Send + Unpin>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Sync>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Sync>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more
source§impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Unpin>
impl<Value: TweenValue> Tween<Value> for Box<dyn Tween<Value> + Unpin>
source§fn tween(&mut self, value_delta: Value, percent: f32) -> Value
fn tween(&mut self, value_delta: Value, percent: f32) -> Value
Returns a new value based on the value_delta and the percent. Read more
source§fn is_finite(&self) -> bool
fn is_finite(&self) -> bool
All Tweens in this library use this default method, except Looper and Oscillator, which
which are both unbounded (because they never stop returning values), and Extrapolator,
which simply unbounds tweens. Read more