pub struct AnimationContainer {
pub animation: Arc<dyn Animation>,
pub start: f32,
pub end: f32,
}Expand description
A wrapper around a animation to provide duration, delay, and other features.
Fields§
§animation: Arc<dyn Animation>The animation to be wrapped.
start: f32The start time of the animation in seconds.
end: f32The end time of the animation in seconds.
Implementations§
Source§impl AnimationContainer
impl AnimationContainer
Sourcepub fn new(animation: Arc<dyn Animation>) -> Self
pub fn new(animation: Arc<dyn Animation>) -> Self
Creates a new AnimationContainer with the given animation.
Default duration is 1 second starting at 0 seconds.
Sourcepub fn duration(self, duration: f32) -> Self
pub fn duration(self, duration: f32) -> Self
Set the end time as to make the duration of the animation the given duration.
Sourcepub fn duration_keep_end(self, duration: f32) -> Self
pub fn duration_keep_end(self, duration: f32) -> Self
Set the start time as to make the duration of the animation the given duration.
Sourcepub fn after(self, other: &AnimationContainer) -> Self
pub fn after(self, other: &AnimationContainer) -> Self
Set the start time to the end time of the given animation. Preserving the duration of the animation.
Sourcepub fn start_with(self, other: &AnimationContainer) -> Self
pub fn start_with(self, other: &AnimationContainer) -> Self
Set the start time to the start time of the given animation.
Sourcepub fn end_with(self, other: &AnimationContainer) -> Self
pub fn end_with(self, other: &AnimationContainer) -> Self
Set the end time to the end time of the given animation.
Sourcepub fn synchronize(self, other: &AnimationContainer) -> Self
pub fn synchronize(self, other: &AnimationContainer) -> Self
Synchronize the start and end time with the given animation.
Trait Implementations§
Source§impl Clone for AnimationContainer
impl Clone for AnimationContainer
Source§fn clone(&self) -> AnimationContainer
fn clone(&self) -> AnimationContainer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AnimationContainer
impl !RefUnwindSafe for AnimationContainer
impl Send for AnimationContainer
impl Sync for AnimationContainer
impl Unpin for AnimationContainer
impl !UnwindSafe for AnimationContainer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more