AnimationController
struct · ferroui-base · v0.5.0
struct AnimationController
Controls running animations: pauses and resumes them, moves them to a
point (Progress) and changes their speed (PlaybackRate) (WinUI
AnimationController).
An animation comes under a controller when it is started with
start_animation_with_controller,
or through try_get_animation_controller
of the object it animates. Key frame and natural motion animations can be
controlled; expression animations are not affected. One controller can
control several animations.
Progress and PlaybackRate can be animated
(controller.start_animation("Progress", expression)), and the controller
can be a reference parameter of an expression (controller.Progress).
Members
MAX_PLAYBACK_RATEMIN_PLAYBACK_RATEcompositorpauseresumeis_pausedplayback_rateset_playback_rateprogressset_progressprogress_behaviorset_progress_behavior
MAX_PLAYBACK_RATE
const MAX_PLAYBACK_RATE: f32
The highest playback rate (WinUI MaxPlaybackRate).
MIN_PLAYBACK_RATE
const MIN_PLAYBACK_RATE: f32
The lowest playback rate (WinUI MinPlaybackRate); a negative rate
plays backwards.
compositor
fn compositor(self: &Self) -> &Rc<Compositor>
The compositor of the controller.
pause
fn pause(self: &Self)
Pauses the controlled animations: their time stops, and they do not end while paused.
resume
fn resume(self: &Self)
Resumes the controlled animations from where they were paused.
is_paused
fn is_paused(self: &Self) -> bool
Whether the controller is paused (not a WinUI member).
playback_rate
fn playback_rate(self: &Self) -> f32
The speed of the controlled animations: 1 is normal speed, 2 twice as fast, a negative rate plays backwards.
set_playback_rate
fn set_playback_rate(self: &Self, value: f32)
Sets the playback rate, clamped to
MIN_PLAYBACK_RATE..MAX_PLAYBACK_RATE.
progress
fn progress(self: &Self) -> f32
The progress last assigned (0..1).
set_progress
fn set_progress(self: &Self, value: f32)
Moves the controlled animations to a point between their start (0) and their end (1), clamped to that range. A playing animation goes on from there; a paused one stays there.
progress_behavior
fn progress_behavior(self: &Self) -> AnimationControllerProgressBehavior
What the progress covers.
set_progress_behavior
fn set_progress_behavior(self: &Self, value: AnimationControllerProgressBehavior)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherAsCompositionObjectICompositionObjectAnimations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.