Animator
trait · ferroui-base · v0.5.0
trait Animator: Sized + 'static
Base class for animators: interpolates the key frames of one property of an animation.
An animator implements interpolate for its value
type; everything else has an implementation that subclasses override
only for special targets (brushes, transforms).
Members
Value
type Value: PropertyValue + Default
The type of the values the animator produces, which is the value type of the properties it animates.
base
fn base(self: &Self) -> &AnimatorBase
The key frames and the target property.
interpolate
fn interpolate(self: &Self, progress: f64, old_value: &<Self as >::Value, new_value: &<Self as >::Value) -> <Self as >::Value
Interpolates between two values using the specified progress.
typed_value
fn typed_value(self: &Self, untyped: &dyn AnyValue) -> Option<<Self as >::Value>
Reads a key frame value; None when it is not a value this animator
can animate, in which case the neutral value is used in its place.
validate
fn validate(self: &Self, _item: &Ref<AnimatorKeyFrame>)
Validates a key frame that is being added. Panics to reject it.
bind_animation
fn bind_animation(self: &Self, control: &Animatable, instance: Rc<dyn IObservable<<Self as >::Value>>) -> Rc<dyn IDisposable>
Binds the values a running animation produces to the target property of the control, at animation priority.
apply
fn apply(this: &Rc<Self>, animation: &Animation, control: &Animatable, clock: Option<Rc<dyn IClock>>, match_: Rc<dyn IObservable<bool>>, on_complete: Option<Rc<dyn Fn() -> ()>>, should_pause_on_invisible: bool) -> Option<Rc<dyn IDisposable>>
Applies the animation to control: it runs while match_ is true.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.