pub struct Options<T: Animatable> { /* private fields */ }
Expand description
options to build an Animation
Implementations§
Source§impl<T: Animatable> Options<T>
impl<T: Animatable> Options<T>
Sourcepub fn auto_reverse(self, auto_reverse: bool) -> Self
pub fn auto_reverse(self, auto_reverse: bool) -> Self
auto reverse animation when it reaches the end; default false. Note: it will not increase the duration or repeat times.
auto_reverse | effect |
---|---|
false | from -> to |
true | from -> to -> from |
Sourcepub fn begin_time(self, begin_time: Duration) -> Self
👎Deprecated
pub fn begin_time(self, begin_time: Duration) -> Self
deprecated, use Options::skip()
instead
Sourcepub fn skip(self, skip: Duration) -> Self
pub fn skip(self, skip: Duration) -> Self
play animation from the specified progress, same effect as Animation::skip()
Sourcepub fn delay(self, delay: Duration) -> Self
pub fn delay(self, delay: Duration) -> Self
play animation with delay, same effect as Animation::delay()
;
take effect only once when the animation loops more than once.
Sourcepub fn duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
animation simple duration, this animation will last for how long if it plays once. default 1 second.
If Options::repeat()
is specified, the animation might play more than once.
Sourcepub fn repeat(self, behavior: RepeatBehavior) -> Self
pub fn repeat(self, behavior: RepeatBehavior) -> Self
repeat behavior
Sourcepub fn forever(self) -> Self
pub fn forever(self) -> Self
your Animation
repeats indefinitely
alias of Options::cycle()
, see Options::repeat()
Sourcepub fn easing(self, func: impl Function + Clone + 'static) -> Self
pub fn easing(self, func: impl Function + Clone + 'static) -> Self
set ease function, default easing::linear
Source§impl<T: Animatable + 'static> Options<T>
impl<T: Animatable + 'static> Options<T>
Sourcepub fn begin_animation(self) -> Timeline<T>
pub fn begin_animation(self) -> Timeline<T>
build Timeline
and start animation
Trait Implementations§
Source§impl<T: Animatable> Clone for Options<T>
impl<T: Animatable> Clone for Options<T>
Auto Trait Implementations§
impl<T> Freeze for Options<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Options<T>
impl<T> !Send for Options<T>
impl<T> !Sync for Options<T>
impl<T> Unpin for Options<T>where
T: Unpin,
impl<T> !UnwindSafe for Options<T>
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