pub struct AnimationOptions {
pub initial: Option<f32>,
pub restart: bool,
pub velocity: Option<f32>,
pub delay: f32,
}Expand description
controls how scalar motion starts and retargets
Fields§
§initial: Option<f32>starting value when first registered with Ui::animate
restart: booldiscards carried velocity when retargeting
velocity: Option<f32>initial spring speed or fading tween momentum in coordinate units per second
None carries the current velocity unless restarting
Some(v) overrides it even when v is zero or restart is true
zero removes carried momentum but a tween still follows its easing
delay: f32seconds to hold the current value before moving toward a new target
starts from rest unless velocity is set
ignored by zero duration animations
Implementations§
Source§impl AnimationOptions
impl AnimationOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
creates a new AnimationOptions
Sourcepub fn restart(self, value: bool) -> Self
pub fn restart(self, value: bool) -> Self
sets Self::restart
Sourcepub fn delay(self, value: f32) -> Self
pub fn delay(self, value: f32) -> Self
sets Self::delay
Trait Implementations§
Source§impl Clone for AnimationOptions
impl Clone for AnimationOptions
impl Copy for AnimationOptions
Source§impl Debug for AnimationOptions
impl Debug for AnimationOptions
Source§impl Default for AnimationOptions
impl Default for AnimationOptions
Source§impl PartialEq for AnimationOptions
impl PartialEq for AnimationOptions
impl StructuralPartialEq for AnimationOptions
Auto Trait Implementations§
impl Forget for AnimationOptions
impl Freeze for AnimationOptions
impl Move for AnimationOptions
impl RefUnwindSafe for AnimationOptions
impl Send for AnimationOptions
impl Sync for AnimationOptions
impl Unpin for AnimationOptions
impl UnsafeUnpin for AnimationOptions
impl UnwindSafe for AnimationOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more