pub struct MotionBindings {
pub translate_x: Option<Arc<Mutex<AnimatedValue>>>,
pub translate_y: Option<Arc<Mutex<AnimatedValue>>>,
pub scale: Option<Arc<Mutex<AnimatedValue>>>,
pub scale_x: Option<Arc<Mutex<AnimatedValue>>>,
pub scale_y: Option<Arc<Mutex<AnimatedValue>>>,
pub rotation: Option<Arc<Mutex<AnimatedValue>>>,
pub rotation_timeline: Option<TimelineRotation>,
pub opacity: Option<Arc<Mutex<AnimatedValue>>>,
}Expand description
Motion bindings for continuous animation driven by AnimatedValue
This struct holds references to animated values that are sampled every frame during rendering, enabling smooth continuous animations.
Fields§
§translate_x: Option<Arc<Mutex<AnimatedValue>>>Animated X translation
translate_y: Option<Arc<Mutex<AnimatedValue>>>Animated Y translation
scale: Option<Arc<Mutex<AnimatedValue>>>Animated uniform scale
scale_x: Option<Arc<Mutex<AnimatedValue>>>Animated X scale
scale_y: Option<Arc<Mutex<AnimatedValue>>>Animated Y scale
rotation: Option<Arc<Mutex<AnimatedValue>>>Animated rotation (degrees) - spring-based
rotation_timeline: Option<TimelineRotation>Animated rotation (degrees) - timeline-based for continuous spin
opacity: Option<Arc<Mutex<AnimatedValue>>>Animated opacity
Implementations§
Source§impl MotionBindings
impl MotionBindings
Sourcepub fn get_transform(&self) -> Option<Transform>
pub fn get_transform(&self) -> Option<Transform>
Get the current translation from animated values
Returns a translation transform for the tx/ty bindings. Scale and rotation should be queried separately for proper centered application.
Sourcepub fn get_scale(&self) -> Option<(f32, f32)>
pub fn get_scale(&self) -> Option<(f32, f32)>
Get the current scale values from animated bindings
Returns (scale_x, scale_y) if any scale is bound. The renderer should apply this centered around the element.
Sourcepub fn get_rotation(&self) -> Option<f32>
pub fn get_rotation(&self) -> Option<f32>
Get the current rotation from animated values (in degrees)
The renderer should apply this centered around the element. Checks timeline-based rotation first, then spring-based.
Sourcepub fn get_opacity(&self) -> Option<f32>
pub fn get_opacity(&self) -> Option<f32>
Get the current opacity from animated value
Trait Implementations§
Source§impl Clone for MotionBindings
impl Clone for MotionBindings
Source§fn clone(&self) -> MotionBindings
fn clone(&self) -> MotionBindings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MotionBindings
impl Default for MotionBindings
Source§fn default() -> MotionBindings
fn default() -> MotionBindings
Auto Trait Implementations§
impl Freeze for MotionBindings
impl RefUnwindSafe for MotionBindings
impl Send for MotionBindings
impl Sync for MotionBindings
impl Unpin for MotionBindings
impl UnsafeUnpin for MotionBindings
impl UnwindSafe for MotionBindings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.