pub struct TransitionScope<T> { /* private fields */ }Expand description
A scope for multi-target animations driven by a changing state.
When the target state changes (detected via PartialEq), all child
animations registered via animate_float, animate_color, etc.
automatically animate from their current value toward the new mapped
target value.
§Example
ⓘ
let t = update_transition("panel", is_expanded, AnimationSpec::spring_gentle());
let h = t.animate_float("height", |e| if *e { 200.0 } else { 48.0 });
let bg = t.animate_color("bg", |e| if *e { theme().primary } else { theme().surface });Implementations§
Source§impl<T> TransitionScope<T>
impl<T> TransitionScope<T>
pub fn animate_float<F>(&self, child_key: impl Into<String>, map: F) -> f32
pub fn animate_color<F>(&self, child_key: impl Into<String>, map: F) -> Color
pub fn animate_vec2<F>(&self, child_key: impl Into<String>, map: F) -> Vec2
pub fn animate_size<F>(&self, child_key: impl Into<String>, map: F) -> Size
pub fn animate_rect<F>(&self, child_key: impl Into<String>, map: F) -> Rect
Auto Trait Implementations§
impl<T> !RefUnwindSafe for TransitionScope<T>
impl<T> !Send for TransitionScope<T>
impl<T> !Sync for TransitionScope<T>
impl<T> !UnwindSafe for TransitionScope<T>
impl<T> Freeze for TransitionScope<T>
impl<T> Unpin for TransitionScope<T>
impl<T> UnsafeUnpin for TransitionScope<T>
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