# CompositionAnimation

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/animations/struct-compositionanimation/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct CompositionAnimation
```

This is the base class for ExpressionAnimation and KeyFrameAnimation.

Use the `start_animation` method of a composition object to start the
animation. Value parameters (as opposed to reference parameters which
are set using `set_reference_parameter`)
are copied and "embedded" into an expression at the time
`start_animation` is called. Changing the value of the variable after
`start_animation` is called will not affect the value of the
ExpressionAnimation. See the remarks of
`ExpressionAnimation` for additional
information.

A class derives from it by embedding it (`base`) and dereferencing to
it; the class implements `ICompositionAnimation`,
whose `Rc<dyn ..>` is the handle of an animation of any class.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L28)

## Members

- [`object`](#function-object)
- [`compositor`](#function-compositor)
- [`clear_all_parameters`](#function-clear_all_parameters)
- [`clear_parameter`](#function-clear_parameter)
- [`set_boolean_parameter`](#function-set_boolean_parameter)
- [`set_color_parameter`](#function-set_color_parameter)
- [`set_expression_reference_parameter`](#function-set_expression_reference_parameter)
- [`set_matrix3x2_parameter`](#function-set_matrix3x2_parameter)
- [`set_matrix4x4_parameter`](#function-set_matrix4x4_parameter)
- [`set_quaternion_parameter`](#function-set_quaternion_parameter)
- [`set_reference_parameter`](#function-set_reference_parameter)
- [`set_scalar_parameter`](#function-set_scalar_parameter)
- [`set_vector2_parameter`](#function-set_vector2_parameter)
- [`set_vector3_parameter`](#function-set_vector3_parameter)
- [`set_vector4_parameter`](#function-set_vector4_parameter)
- [`target`](#function-target)
- [`set_target`](#function-set_target)

<a id="function-object"></a>

### object

```rust
fn object(self: &Self) -> &CompositionObject
```

The embedded `CompositionObject`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L46)

<a id="function-compositor"></a>

### compositor

```rust
fn compositor(self: &Self) -> &Rc<Compositor>
```

The associated compositor.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L51)

<a id="function-clear_all_parameters"></a>

### clear_all_parameters

```rust
fn clear_all_parameters(self: &Self)
```

Clears all of the parameters of the animation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L56)

<a id="function-clear_parameter"></a>

### clear_parameter

```rust
fn clear_parameter(self: &Self, key: &str)
```

Clears a parameter from the animation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L61)

<a id="function-set_boolean_parameter"></a>

### set_boolean_parameter

```rust
fn set_boolean_parameter(self: &Self, key: &str, value: bool)
```

Sets a boolean value parameter for use with an expression animation
or an expression key frame.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L71)

<a id="function-set_color_parameter"></a>

### set_color_parameter

```rust
fn set_color_parameter(self: &Self, key: &str, value: Color)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L75)

<a id="function-set_expression_reference_parameter"></a>

### set_expression_reference_parameter

```rust
fn set_expression_reference_parameter(self: &Self, key: &str, animation_object: Rc<dyn AsCompositionObject>)
```

Sets an object as a reference parameter of an expression: the
expression reads its properties (`key.Offset`) every time it is
evaluated, as with `set_reference_parameter`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L88)

<a id="function-set_matrix3x2_parameter"></a>

### set_matrix3x2_parameter

```rust
fn set_matrix3x2_parameter(self: &Self, key: &str, value: Matrix3x2)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L92)

<a id="function-set_matrix4x4_parameter"></a>

### set_matrix4x4_parameter

```rust
fn set_matrix4x4_parameter(self: &Self, key: &str, value: Matrix4x4)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L96)

<a id="function-set_quaternion_parameter"></a>

### set_quaternion_parameter

```rust
fn set_quaternion_parameter(self: &Self, key: &str, value: Quaternion)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L100)

<a id="function-set_reference_parameter"></a>

### set_reference_parameter

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L104)

<a id="function-set_scalar_parameter"></a>

### set_scalar_parameter

```rust
fn set_scalar_parameter(self: &Self, key: &str, value: f32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L108)

<a id="function-set_vector2_parameter"></a>

### set_vector2_parameter

```rust
fn set_vector2_parameter(self: &Self, key: &str, value: Vector2)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L112)

<a id="function-set_vector3_parameter"></a>

### set_vector3_parameter

```rust
fn set_vector3_parameter(self: &Self, key: &str, value: Vector3)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L116)

<a id="function-set_vector4_parameter"></a>

### set_vector4_parameter

```rust
fn set_vector4_parameter(self: &Self, key: &str, value: Vector4)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L120)

<a id="function-target"></a>

### target

```rust
fn target(self: &Self) -> Option<String>
```

The name of the property the animation targets.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L125)

<a id="function-set_target"></a>

### set_target

```rust
fn set_target(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/animations/composition_animation.rs#L129)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
