FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ParallaxAnimation

    struct · ferroui-xaml-behaviors-animations · v0.5.0

    struct ParallaxAnimation
    

    Applies composition-based parallax offsets without requiring a behavior.

    View source

    Members

    calculate_offset

    fn calculate_offset(scroll_offset: Vector, parallax_ratio: f64) -> Vector3
    

    Calculates the composition offset for a scroll offset and parallax ratio (the proportion of the scroll offset to apply). Returns the parallax delta to add to the target's layout offset.

    Source

    try_create

    fn try_create(target: Option<&Control>) -> Option<ParallaxAnimation>
    

    Creates a parallax animation session that retains the target's composition visual, or None when the target visual is unavailable.

    Source

    apply

    fn apply(self: &Self, scroll_offset: Vector, parallax_ratio: f64)
    

    Applies a calculated parallax offset to the retained composition visual.

    Source

    apply_to

    fn apply_to(target: Option<&Control>, scroll_offset: Vector, parallax_ratio: f64) -> bool
    

    Applies a calculated parallax offset to a control's composition visual. Returns true when a composition visual was updated; otherwise, false.

    Deviation (DEVIATIONS.md, Behaviors): the static Apply(Control, Vector, double) overload of the reference; Rust has no overloads.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

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