Struct libbismuth::builders::SpringAnimationBuilder
source · pub struct SpringAnimationBuilder { /* private fields */ }
Expand description
A builder-pattern type to construct SpringAnimation
objects.
Implementations§
source§impl SpringAnimationBuilder
impl SpringAnimationBuilder
sourcepub fn epsilon(self, epsilon: f64) -> Self
pub fn epsilon(self, epsilon: f64) -> Self
Precision of the spring.
The level of precision used to determine when the animation has come to a rest, that is, when the amplitude of the oscillations becomes smaller than this value.
If the epsilon value is too small, the animation will take a long time to stop after the animated value has stopped visibly changing.
If the epsilon value is too large, the animation will end prematurely.
The default value is 0.001.
sourcepub fn initial_velocity(self, initial_velocity: f64) -> Self
pub fn initial_velocity(self, initial_velocity: f64) -> Self
The initial velocity to start the animation with.
Initial velocity affects only the animation curve, but not its duration.
sourcepub fn latch(self, latch: bool) -> Self
pub fn latch(self, latch: bool) -> Self
Whether the animation should be latched.
If set to TRUE
, the animation will abruptly end as soon as it reaches the
final value, preventing overshooting.
It won’t prevent overshooting value-from
if a
relative negative initial-velocity
is set.
sourcepub fn spring_params(self, spring_params: &SpringParams) -> Self
pub fn spring_params(self, spring_params: &SpringParams) -> Self
Physical parameters describing the spring.
sourcepub fn value_from(self, value_from: f64) -> Self
pub fn value_from(self, value_from: f64) -> Self
The value to animate from.
The animation will start at this value and end at
value-to
.
sourcepub fn value_to(self, value_to: f64) -> Self
pub fn value_to(self, value_to: f64) -> Self
The value to animate to.
The animation will start at value-from
and end
at this value.
sourcepub fn target(self, target: &impl IsA<AnimationTarget>) -> Self
pub fn target(self, target: &impl IsA<AnimationTarget>) -> Self
The target to animate.
sourcepub fn widget(self, widget: &impl IsA<Widget>) -> Self
pub fn widget(self, widget: &impl IsA<Widget>) -> Self
The animation widget.
It provides the frame clock for the animation. It’s not strictly necessary for this widget to be same as the one being animated.
The widget must be mapped in order for the animation to work. If it’s not mapped, or if it gets unmapped during an ongoing animation, the animation will be automatically skipped.
sourcepub fn build(self) -> SpringAnimation
pub fn build(self) -> SpringAnimation
Build the SpringAnimation
.