Skip to main content

KeyFrameAnimation

Struct KeyFrameAnimation 

Source
pub struct KeyFrameAnimation { /* private fields */ }
Expand description

A time-based animation with one or more key frames. These frames are markers, allowing developers to specify values at specific times for the animating property. KeyFrame animations can be further customized by specifying how the animation interpolates between keyframes.

The classes for the value types (ScalarKeyFrameAnimation, Vector3KeyFrameAnimation, …) embed it and dereference to it; they are expanded from the key frame animations of the composition schema at the end of this module.

Implementations§

Source§

impl KeyFrameAnimation

Source

pub fn delay_behavior(&self) -> AnimationDelayBehavior

The delay behavior of the key frame animation.

Source

pub fn set_delay_behavior(&self, value: AnimationDelayBehavior)

Source

pub fn delay_time(&self) -> Duration

Delay before the animation starts after start_animation is called.

Source

pub fn set_delay_time(&self, value: Duration)

Source

pub fn direction(&self) -> PlaybackDirection

The direction the animation is playing. The Direction property allows you to drive your animation from start to end or end to start or alternate between start and end or end to start if animation has an iteration_count greater than one. This gives an easy way for customizing animation definitions.

Source

pub fn set_direction(&self, value: PlaybackDirection)

Source

pub fn duration(&self) -> Duration

The duration of the animation. Minimum allowed value is 1ms and maximum allowed value is 24 days.

Source

pub fn set_duration(&self, value: Duration)

Sets the duration. As upstream, the range check is made on the current value rather than on the new one.

Source

pub fn iteration_behavior(&self) -> AnimationIterationBehavior

The iteration behavior for the key frame animation.

Source

pub fn set_iteration_behavior(&self, value: AnimationIterationBehavior)

Source

pub fn iteration_count(&self) -> i32

The number of times to repeat the key frame animation.

Source

pub fn set_iteration_count(&self, value: i32)

Source

pub fn stop_behavior(&self) -> AnimationStopBehavior

Specifies how to set the property value when animation is stopped

Source

pub fn set_stop_behavior(&self, value: AnimationStopBehavior)

Source

pub fn insert_expression_key_frame( &self, normalized_progress_key: f32, value: &str, easing_function: Option<Easing>, )

Inserts an expression keyframe.

normalized_progress_key is the time the key frame should occur at, expressed as a percentage of the animation Duration. Allowed value is from 0.0 to 1.0. value is the expression used to calculate the value of the key frame. easing_function is the easing function to use when interpolating between frames; the default easing of the compositor when None.

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 Deref for KeyFrameAnimation

Source§

type Target = CompositionAnimation

The resulting type after dereferencing.
Source§

fn deref(&self) -> &CompositionAnimation

Dereferences the value.

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.