# IAnimator

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/animation/trait-ianimator/

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

```rust
trait IAnimator: 'static
```

Interface for animator objects: the list of the key frames of one
property of an animation, and the logic that plays them.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L9)

## Members

- [`property`](#function-property)
- [`set_property`](#function-set_property)
- [`count`](#function-count)
- [`get`](#function-get)
- [`add`](#function-add)
- [`animator_type`](#function-animator_type)
- [`apply`](#function-apply)

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

### property

```rust
fn property(self: &Self) -> Option<&'static FerroProperty>
```

The target property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L11)

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

### set_property

```rust
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L13)

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

### count

```rust
fn count(self: &Self) -> usize
```

The number of key frames.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L16)

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

### get

```rust
fn get(self: &Self, index: usize) -> Ref<AnimatorKeyFrame>
```

The key frame at `index`. Panics when out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L19)

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

### add

```rust
fn add(self: &Self, item: Ref<AnimatorKeyFrame>)
```

Adds a key frame. Key frames are expected in cue order.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L22)

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

### animator_type

```rust
fn animator_type(self: &Self) -> TypeId
```

The type of the animator, by which key frames find their animator.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L25)

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

### apply

```rust
fn apply(self: Rc<Self>, animation: &Animation, control: &Animatable, clock: Option<Rc<dyn IClock>>, match_: Rc<dyn IObservable<bool>>, on_complete: Option<Rc<dyn Fn() -> ()>>, should_pause_on_invisible: bool) -> Option<Rc<dyn IDisposable>>
```

Applies the animation to a control: the animation runs while
`match_` is true.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/i_animator.rs#L29)

## Trait implementations

- [`IAnimator`](/docs/0.5.0/api/ferroui-base/animation/trait-ianimator/)

## Availability

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