pub struct AnimLagged {
animations: Vec<AnimNode>,
lag_ratio: f64,
cursor_sec: f64,
duration_secs: f64,
leading: LaggedFill,
trailing: LaggedFill,
}Expand description
Dynamic lagged (staggered, end-filled) animation container.
Children are pushed un-placed (Unplaced); the container computes the
placement itself: child i starts at start_{i-1} + lag_ratio · d_{i-1}.
lag_ratio interpolates between the other two containers:
0.0— all children start together (likeAnimStack);1.0— each child starts when the previous ends (likeAnimSequence);- in between — overlapping succession.
By default the time outside a child’s window is filled with real static
cells (LaggedFill::Hold on both ends): each item is materialized at
build time as a per-item sequence track [leading fill][anim][trailing fill] spanning the whole extent — before its start the item shows its
initial state, after its end it keeps showing its final state, and the
preview timeline shows exactly what is rendered. Configure with
with_leading /
with_trailing — e.g. Empty leading makes items
appear only at their window; to hide an item after its window instead of
holding it, give it an animation that ends hidden, e.g.
seq![item.fade_in(), item.hide()].
Fills are sampled at build time: empty fills are skipped, and a zero-duration child gets no leading fill (it appears at its point, which is what “show from that point on” means). Because fills are build-time samples, children are expected to be pure (closed-form) animations — a stateful child’s trailing fill would be its initial state, not its true final state.
Fields§
§animations: Vec<AnimNode>§lag_ratio: f64§cursor_sec: f64Start offset for the next pushed child.
duration_secs: f64§leading: LaggedFill§trailing: LaggedFillImplementations§
Source§impl AnimLagged
impl AnimLagged
Sourcepub fn new(lag_ratio: f64) -> Self
pub fn new(lag_ratio: f64) -> Self
Create an empty lagged container with the given stagger ratio.
Sourcepub fn with_leading(self, behavior: LaggedFill) -> Self
pub fn with_leading(self, behavior: LaggedFill) -> Self
Configure the fill before each child’s window (default
LaggedFill::Hold).
Sourcepub fn with_trailing(self, behavior: LaggedFill) -> Self
pub fn with_trailing(self, behavior: LaggedFill) -> Self
Configure the fill after each child’s window (default
LaggedFill::Hold).
Sourcepub fn push<A: Unplaced + 'static>(&mut self, animation: A) -> &mut Self
pub fn push<A: Unplaced + 'static>(&mut self, animation: A) -> &mut Self
Add an animation, placed by the container’s stagger rule.
Sourcefn materialize_fills(&mut self)
fn materialize_fills(&mut self)
Materialize each child as a per-item sequence track:
[leading fill][anim][trailing fill] (empty fills skipped).
The lagged container is thus a stack of per-item sequences — each item’s track spans the whole extent, with its window-edge states held by real static cells.
Sourcepub fn duration_secs(&self) -> f64
pub fn duration_secs(&self) -> f64
Current total extent (the last child’s end).
Sourcepub fn built_animations(&self) -> &[AnimNode]
pub fn built_animations(&self) -> &[AnimNode]
Borrow the children as placed by the stagger rule — the
pre-materialization view, before build turns them into filled
tracks.
Trait Implementations§
Source§impl IntoAnimNode for AnimLagged
impl IntoAnimNode for AnimLagged
Source§fn into_anim_node(self) -> AnimNode
fn into_anim_node(self) -> AnimNode
Desugar: materialize each item into a full-extent sequence track,
then lower the whole container to a plain runtime stack node — the
stagger is ordinary window placement, so lagged needs no
runtime kind of its own. anim_name keeps the authoring identity.
Auto Trait Implementations§
impl !RefUnwindSafe for AnimLagged
impl !Send for AnimLagged
impl !Sync for AnimLagged
impl !UnwindSafe for AnimLagged
impl Freeze for AnimLagged
impl Unpin for AnimLagged
impl UnsafeUnpin for AnimLagged
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<A> PlaybackExt for Awhere
A: Unplaced,
impl<A> PlaybackExt for Awhere
A: Unplaced,
Source§fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
Source§fn with_duration(self, duration_secs: f64) -> Paramed<Self>
fn with_duration(self, duration_secs: f64) -> Paramed<Self>
Source§fn with_enabled(self, enabled: bool) -> Paramed<Self>
fn with_enabled(self, enabled: bool) -> Paramed<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformedExt for T
impl<T> TransformedExt for T
Source§fn transformed<G>(self, transform: G) -> Transformed<Self, G>
fn transformed<G>(self, transform: G) -> Transformed<Self, G>
self wrapped with transform stored exactly as G.