pub struct ExpressionAnimation { /* private fields */ }Expand description
A Composition Animation that uses a mathematical equation to calculate the value for an animating property every frame.
The core of ExpressionAnimations allows a developer to define a mathematical equation that can be used to calculate the value
of a targeted animating property each frame.
This contrasts KeyFrameAnimations, which use an interpolator to define how the animating
property changes over time. The mathematical equation can be defined using references to properties
of Composition objects, mathematical functions and operators and Input.
Use the start_animation method of a composition object to start the animation.
Implementations§
Source§impl ExpressionAnimation
impl ExpressionAnimation
Sourcepub fn expression(&self) -> Option<String>
pub fn expression(&self) -> Option<String>
The mathematical equation specifying how the animated value is calculated each frame.
The Expression is the core of an ExpressionAnimation and represents the equation
the system will use to calculate the value of the animation property each frame.
The equation is set on this property in the form of a string.
Although expressions can be defined by simple mathematical equations such as “2+2”,
the real power lies in creating mathematical relationships where the input values can change frame over frame.
pub fn set_expression(&self, value: Option<String>)
Methods from Deref<Target = CompositionAnimation>§
Sourcepub fn object(&self) -> &CompositionObject
pub fn object(&self) -> &CompositionObject
The embedded CompositionObject.
Sourcepub fn compositor(&self) -> &Rc<Compositor>
pub fn compositor(&self) -> &Rc<Compositor>
The associated compositor.
Sourcepub fn clear_all_parameters(&self)
pub fn clear_all_parameters(&self)
Clears all of the parameters of the animation.
Sourcepub fn clear_parameter(&self, key: &str)
pub fn clear_parameter(&self, key: &str)
Clears a parameter from the animation.
pub fn set_color_parameter(&self, key: &str, value: Color)
pub fn set_matrix3x2_parameter(&self, key: &str, value: Matrix3x2)
pub fn set_matrix4x4_parameter(&self, key: &str, value: Matrix4x4)
pub fn set_quaternion_parameter(&self, key: &str, value: Quaternion)
pub fn set_reference_parameter( &self, key: &str, composition_object: Rc<dyn AsCompositionObject>, )
pub fn set_scalar_parameter(&self, key: &str, value: f32)
pub fn set_vector2_parameter(&self, key: &str, value: Vector2)
pub fn set_vector3_parameter(&self, key: &str, value: Vector3)
pub fn set_vector4_parameter(&self, key: &str, value: Vector4)
pub fn set_target(&self, value: Option<String>)
Trait Implementations§
Source§impl AsCompositionObject for ExpressionAnimation
impl AsCompositionObject for ExpressionAnimation
Source§fn as_composition_object(&self) -> &CompositionObject
fn as_composition_object(&self) -> &CompositionObject
CompositionObject.Source§fn composition_type_name(&self) -> &'static str
fn composition_type_name(&self) -> &'static str
Source§fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
is CompositionPropertySet test of upstream).Source§impl Deref for ExpressionAnimation
impl Deref for ExpressionAnimation
Source§type Target = CompositionAnimation
type Target = CompositionAnimation
Source§fn deref(&self) -> &CompositionAnimation
fn deref(&self) -> &CompositionAnimation
Source§impl ICompositionAnimation for ExpressionAnimation
impl ICompositionAnimation for ExpressionAnimation
Source§fn create_instance(
&self,
target_object: ServerObjectId,
final_value: Option<ExpressionVariant>,
) -> AnimationInstanceFactory
fn create_instance( &self, target_object: ServerObjectId, final_value: Option<ExpressionVariant>, ) -> AnimationInstanceFactory
target_object, as the factory that is sent to the server. final_value is the value the property was just
set to when the animation is implicit.Source§impl ICompositionAnimationBase for ExpressionAnimation
impl ICompositionAnimationBase for ExpressionAnimation
Source§fn as_composition_animation(&self) -> Option<&dyn ICompositionAnimation>
fn as_composition_animation(&self) -> Option<&dyn ICompositionAnimation>
Source§fn as_composition_animation_group(&self) -> Option<&CompositionAnimationGroup>
fn as_composition_animation_group(&self) -> Option<&CompositionAnimationGroup>
Auto Trait Implementations§
impl !Freeze for ExpressionAnimation
impl !RefUnwindSafe for ExpressionAnimation
impl !Send for ExpressionAnimation
impl !Sync for ExpressionAnimation
impl !UnwindSafe for ExpressionAnimation
impl Unpin for ExpressionAnimation
impl UnsafeUnpin for ExpressionAnimation
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more