pub struct Transition {
pub ms: u32,
pub easing: Easing,
pub delay: u32,
pub alternate: bool,
}Expand description
How long an animation takes, how it moves, and how long it waits first. Copy it into styles and constants like a color.
Fields§
§ms: u32The time it takes, in milliseconds. 0 jumps straight to the end.
easing: EasingHow it moves.
delay: u32How long it waits before it moves, in milliseconds.
alternate: boolWhether a Cx::cycle comes back each round instead of starting
over. Nothing else reads it.
Implementations§
Source§impl Transition
impl Transition
Sourcepub const fn new(ms: u32) -> Transition
pub const fn new(ms: u32) -> Transition
A transition of ms milliseconds, easing out, with no delay.
Sourcepub const fn easing(self, easing: Easing) -> Transition
pub const fn easing(self, easing: Easing) -> Transition
The same transition moving as easing says.
Sourcepub const fn delay(self, ms: u32) -> Transition
pub const fn delay(self, ms: u32) -> Transition
The same transition waiting ms milliseconds before it moves.
Sourcepub const fn alternate(self) -> Transition
pub const fn alternate(self) -> Transition
The same transition coming back after each round of a
Cx::cycle, so it goes 0 to 1 to 0, each way taking ms.
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
impl Copy for Transition
Source§impl Debug for Transition
impl Debug for Transition
Source§impl PartialEq for Transition
impl PartialEq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Forget for Transition
impl Freeze for Transition
impl Move for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnsafeUnpin for Transition
impl UnwindSafe for Transition
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