pub struct AnimatedFloat { /* private fields */ }
Expand description
A Float value that may be animated over time.
Implementations
sourceimpl AnimatedFloat
impl AnimatedFloat
pub fn new(value: f32, listener: Option<Listener2<f32, f32>>) -> Self
pub fn get(&self) -> f32
pub fn set(&self, value: f32)
pub fn update(&self, dt: f32)
sourcepub fn animate(
&self,
from: f32,
to: f32,
seconds: f32,
easing: Option<EaseFunction>
)
pub fn animate(
&self,
from: f32,
to: f32,
seconds: f32,
easing: Option<EaseFunction>
)
Animates between the two given values.
@param from The initial value.
@param to The target value.
@param seconds The animation duration, in seconds.
@param easing The easing fn to use, defaults to Ease.linear
.
sourcepub fn animate_to(&self, to: f32, seconds: f32, easing: Option<EaseFunction>)
pub fn animate_to(&self, to: f32, seconds: f32, easing: Option<EaseFunction>)
Animates between the current value and the given value.
@param to The target value.
@param seconds The animation duration, in seconds.
@param easing The easing fn to use, defaults to Ease.linear
.
sourcepub fn animate_by(&self, by: f32, seconds: f32, easing: Option<EaseFunction>)
pub fn animate_by(&self, by: f32, seconds: f32, easing: Option<EaseFunction>)
Animates the current value by the given delta.
@param by The delta added to the current value to get the target value.
@param seconds The animation duration, in seconds.
@param easing The easing fn to use, defaults to Ease.linear
.
pub fn bind_to(&self, to: Value<f32>, function: Option<BindingFunction>)
pub fn set_behavior(&self, behavior: Option<Rc<dyn Behavior>>)
pub fn behavior(&self) -> Option<Rc<dyn Behavior>>
Trait Implementations
sourceimpl Clone for AnimatedFloat
impl Clone for AnimatedFloat
sourcefn clone(&self) -> AnimatedFloat
fn clone(&self) -> AnimatedFloat
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AnimatedFloat
impl Debug for AnimatedFloat
sourceimpl Default for AnimatedFloat
impl Default for AnimatedFloat
Auto Trait Implementations
impl !RefUnwindSafe for AnimatedFloat
impl !Send for AnimatedFloat
impl !Sync for AnimatedFloat
impl Unpin for AnimatedFloat
impl !UnwindSafe for AnimatedFloat
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.