FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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).

    View source

    Members

    MAX_PLAYBACK_RATE

    const MAX_PLAYBACK_RATE: f32
    

    The highest playback rate (WinUI MaxPlaybackRate).

    Source

    MIN_PLAYBACK_RATE

    const MIN_PLAYBACK_RATE: f32
    

    The lowest playback rate (WinUI MinPlaybackRate); a negative rate plays backwards.

    Source

    compositor

    fn compositor(self: &Self) -> &Rc<Compositor>
    

    The compositor of the controller.

    Source

    pause

    fn pause(self: &Self)
    

    Pauses the controlled animations: their time stops, and they do not end while paused.

    Source

    resume

    fn resume(self: &Self)
    

    Resumes the controlled animations from where they were paused.

    Source

    is_paused

    fn is_paused(self: &Self) -> bool
    

    Whether the controller is paused (not a WinUI member).

    Source

    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.

    Source

    set_playback_rate

    fn set_playback_rate(self: &Self, value: f32)
    

    Sets the playback rate, clamped to MIN_PLAYBACK_RATE..MAX_PLAYBACK_RATE.

    Source

    progress

    fn progress(self: &Self) -> f32
    

    The progress last assigned (0..1).

    Source

    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.

    Source

    progress_behavior

    fn progress_behavior(self: &Self) -> AnimationControllerProgressBehavior
    

    What the progress covers.

    Source

    set_progress_behavior

    fn set_progress_behavior(self: &Self, value: AnimationControllerProgressBehavior)
    

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.