pub struct Timeline {
anims: Vec<Box<dyn CoreItemAnimation>>,
cur_sec: f64,
planning_static_start_sec: Option<f64>,
}Expand description
A timeline for a animations.
Fields§
§anims: Vec<Box<dyn CoreItemAnimation>>§cur_sec: f64§planning_static_start_sec: Option<f64>The start time of the planning static anim. When it is some, it means that it is showing and has a planning static anim.
Implementations§
Source§impl Timeline
impl Timeline
Sourcepub fn show(&mut self) -> &mut Self
pub fn show(&mut self) -> &mut Self
Show the item.
This will start planning an static anim if there isn’t an planning static anim.
Sourcepub fn hide(&mut self) -> &mut Self
pub fn hide(&mut self) -> &mut Self
Hide the item.
This will submit a static anim if there is an planning static anim.
Sourcepub fn forward_to(&mut self, target_sec: f64) -> &mut Self
pub fn forward_to(&mut self, target_sec: f64) -> &mut Self
Forward the timeline to target_sec if the current sec is smaller than it.
fn _submit_planning_static_anim(&mut self) -> bool
Sourcepub fn play<T: AnyExtractCoreItem>(
&mut self,
anim: AnimationCell<T>,
) -> &mut Self
pub fn play<T: AnyExtractCoreItem>( &mut self, anim: AnimationCell<T>, ) -> &mut Self
Plays an anim.
Trait Implementations§
Source§impl TimelineFunc for Timeline
impl TimelineFunc for Timeline
Source§fn start_sec(&self) -> Option<f64>
fn start_sec(&self) -> Option<f64>
The start sec of the timeline(the start sec of the first animation.)
Source§fn end_sec(&self) -> Option<f64>
fn end_sec(&self) -> Option<f64>
The end sec of the timeline(the end sec of the last animation.)
Source§fn get_animation_infos(&self) -> Vec<AnimationInfo>
fn get_animation_infos(&self) -> Vec<AnimationInfo>
Get the animation infos
Source§fn eval_primitives_at_sec(
&self,
target_sec: f64,
) -> Option<(usize, Vec<CoreItem>)>
fn eval_primitives_at_sec( &self, target_sec: f64, ) -> Option<(usize, Vec<CoreItem>)>
Evaluate timeline’s primitives at target sec
Source§fn forward_to(&mut self, target_sec: f64)
fn forward_to(&mut self, target_sec: f64)
Forward the timeline to
target_secAuto Trait Implementations§
impl Freeze for Timeline
impl !RefUnwindSafe for Timeline
impl !Send for Timeline
impl !Sync for Timeline
impl Unpin for Timeline
impl !UnwindSafe for Timeline
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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