Struct libbismuth::builders::SpringAnimationBuilder

source ·
pub struct SpringAnimationBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct SpringAnimation objects.

Implementations§

source§

impl SpringAnimationBuilder

source

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.

source

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.

source

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.

source

pub fn spring_params(self, spring_params: &SpringParams) -> Self

Physical parameters describing the spring.

source

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.

source

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.

source

pub fn target(self, target: &impl IsA<AnimationTarget>) -> Self

The target to animate.

source

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.

source

pub fn build(self) -> SpringAnimation

Build the SpringAnimation.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.