Struct mina::TimelineConfiguration
source · pub struct TimelineConfiguration<Data>where
Data: Clone + Debug,{ /* private fields */ }Expand description
Configuration and fluent builder interface for a Timeline type.
Works with TimelineBuilder to aid in the creation of timelines. TimelineBuilder cannot be
implemented ahead of time, because it depends on the specific set of animation properties;
to complete the API, applications (or the Animate macro) define an
implementation of TimelineBuilder for the TimelineConfiguration whose keyframe type
corresponds to the specific timeline being created.
Refer to the macroless_timeline example for details on how the two are connected.
Implementations§
source§impl<Data> TimelineConfiguration<Data>where
Data: Clone + Debug,
impl<Data> TimelineConfiguration<Data>where Data: Clone + Debug,
sourcepub fn default_easing(
self,
default_easing: Easing
) -> TimelineConfiguration<Data>
pub fn default_easing( self, default_easing: Easing ) -> TimelineConfiguration<Data>
Configures the default easing for this timeline.
The default easing is applied until a Keyframe overrides it. Once a frame specifies its
own easing, that becomes the new default until another frame overrides it again, etc. If no
keyframes specify their own easing, then this easing applies to every frame.
sourcepub fn delay_seconds(self, delay_seconds: f32) -> TimelineConfiguration<Data>
pub fn delay_seconds(self, delay_seconds: f32) -> TimelineConfiguration<Data>
Configures the delay, in seconds, before the animation will start.
Delay is applied once at the beginning of the timeline, and does not contribute to the
duration_seconds, nor does it apply to any cycles after the
first if a repeat setting is specified.
sourcepub fn duration_seconds(
self,
duration_seconds: f32
) -> TimelineConfiguration<Data>
pub fn duration_seconds( self, duration_seconds: f32 ) -> TimelineConfiguration<Data>
Configures the animation duration, in seconds.
If the animation repeats, this is the duration of each cycle. If the animation reverses, regardless of whether or not it repeats, then the first half of the duration is used for the forward animation and the second half is used for the reverse animation.
sourcepub fn keyframe(
self,
builder: impl KeyframeBuilder<Data = Data>
) -> TimelineConfiguration<Data>
pub fn keyframe( self, builder: impl KeyframeBuilder<Data = Data> ) -> TimelineConfiguration<Data>
Adds a single Keyframe to the animation, using the supplied builder to create the
keyframe along with its specific typed data.
sourcepub fn repeat(self, repeat: Repeat) -> TimelineConfiguration<Data>
pub fn repeat(self, repeat: Repeat) -> TimelineConfiguration<Data>
Configures the number of repetitions (cycles).
sourcepub fn reverse(self, reverse: bool) -> TimelineConfiguration<Data>
pub fn reverse(self, reverse: bool) -> TimelineConfiguration<Data>
Configures whether or not the animation should automatically reverse.
Reversing takes up the second half of any given cycle and uses the same keyframes, easing and other timing properties as the normal forward animation.
Trait Implementations§
source§impl<Data> Clone for TimelineConfiguration<Data>where
Data: Clone + Debug,
impl<Data> Clone for TimelineConfiguration<Data>where Data: Clone + Debug,
source§fn clone(&self) -> TimelineConfiguration<Data>
fn clone(&self) -> TimelineConfiguration<Data>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more