pub struct Transition {
pub duration_ms: f32,
pub easing: Easing,
pub repeat: Repeat,
pub bounce: Option<Bounce>,
pub delay_ms: f32,
}Expand description
How a node’s animatable values move when the view changes them: a
duration, an easing (a timed curve or a spring), and for keyframes a
repeat direction and a delay. Built with Transition::ms and the
builders, or through the NodeSpec shorthands (transition, easing,
bounce, repeat, delay).
Fields§
§duration_ms: f32How long a timed curve takes; for a spring, its response time — about how long it takes to get there.
easing: Easing§repeat: RepeatHow the node’s keyframes cycle (nothing without keyframes).
bounce: Option<Bounce>A spring’s bounce in place of its easing’s own; on a timed curve
it makes the transition a spring (Self::curve). None is the
easing’s.
delay_ms: f32Holds the keyframe cycle back by this many ms, so siblings given
different delays run out of phase (CSS’s animation-delay).
Implementations§
Source§impl Transition
impl Transition
Sourcepub fn delay(self, delay_ms: f32) -> Self
pub fn delay(self, delay_ms: f32) -> Self
Holds a keyframe cycle back by delay_ms (CSS’s animation-delay).
Sourcepub fn bounce(self, bounce: f32) -> Self
pub fn bounce(self, bounce: f32) -> Self
Springs with this bounce, 0 (no overshoot) to MAX_BOUNCE: on a
spring easing in place of its own, and on a timed one in place of
the curve, since a bounce is only a spring’s to have.
Sourcepub fn curve(&self) -> Easing
pub fn curve(&self) -> Easing
The easing this transition moves by: its easing, or
Easing::Spring when a bounce was given to a timed curve.