Skip to main content

ExpressionAnimation

Struct ExpressionAnimation 

Source
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

Source

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.

Source

pub fn set_expression(&self, value: Option<String>)

Methods from Deref<Target = CompositionAnimation>§

Source

pub fn object(&self) -> &CompositionObject

The embedded CompositionObject.

Source

pub fn compositor(&self) -> &Rc<Compositor>

The associated compositor.

Source

pub fn clear_all_parameters(&self)

Clears all of the parameters of the animation.

Source

pub fn clear_parameter(&self, key: &str)

Clears a parameter from the animation.

Source

pub fn set_color_parameter(&self, key: &str, value: Color)

Source

pub fn set_matrix3x2_parameter(&self, key: &str, value: Matrix3x2)

Source

pub fn set_matrix4x4_parameter(&self, key: &str, value: Matrix4x4)

Source

pub fn set_quaternion_parameter(&self, key: &str, value: Quaternion)

Source

pub fn set_reference_parameter( &self, key: &str, composition_object: Rc<dyn AsCompositionObject>, )

Source

pub fn set_scalar_parameter(&self, key: &str, value: f32)

Source

pub fn set_vector2_parameter(&self, key: &str, value: Vector2)

Source

pub fn set_vector3_parameter(&self, key: &str, value: Vector3)

Source

pub fn set_vector4_parameter(&self, key: &str, value: Vector4)

Source

pub fn target(&self) -> Option<String>

The name of the property the animation targets.

Source

pub fn set_target(&self, value: Option<String>)

Trait Implementations§

Source§

impl AsCompositionObject for ExpressionAnimation

Source§

fn as_composition_object(&self) -> &CompositionObject

The embedded CompositionObject.
Source§

fn composition_type_name(&self) -> &'static str

The name of the class of the object, for messages.
Source§

fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>

The object as a property set, if it is one (the is CompositionPropertySet test of upstream).
Source§

impl Deref for ExpressionAnimation

Source§

type Target = CompositionAnimation

The resulting type after dereferencing.
Source§

fn deref(&self) -> &CompositionAnimation

Dereferences the value.
Source§

impl ICompositionAnimation for ExpressionAnimation

Source§

fn target(&self) -> Option<String>

The name of the property the animation targets, if set.
Source§

fn create_instance( &self, target_object: ServerObjectId, final_value: Option<ExpressionVariant>, ) -> AnimationInstanceFactory

Creates the server-side instance of the animation for a property of 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

Source§

fn as_composition_animation(&self) -> Option<&dyn ICompositionAnimation>

The animation when it is a single animation rather than a group.
Source§

fn as_composition_animation_group(&self) -> Option<&CompositionAnimationGroup>

The group when it is a group of animations.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.