ParallaxAnimation
struct · ferroui-xaml-behaviors-animations · v0.5.0
struct ParallaxAnimation
Applies composition-based parallax offsets without requiring a behavior.
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.
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.
apply
fn apply(self: &Self, scroll_offset: Vector, parallax_ratio: f64)
Applies a calculated parallax offset to the retained composition visual.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.