# RotateAnimation

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-behaviors-animations/struct-rotateanimation/

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

```rust
struct RotateAnimation
```

Provides rotation animation helpers using composition animations.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L10)

## Members

- [`set_rotate_clockwise`](#function-set_rotate_clockwise)
- [`set_rotate_counter_clockwise`](#function-set_rotate_counter_clockwise)
- [`set_rotate_in`](#function-set_rotate_in)
- [`set_rotate_out`](#function-set_rotate_out)
- [`set_flip`](#function-set_flip)
- [`set_swing`](#function-set_swing)
- [`set_custom_rotate`](#function-set_custom_rotate)

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

### set_rotate_clockwise

```rust
fn set_rotate_clockwise(element: &Control, milliseconds: f64)
```

Applies a clockwise rotation animation to the element when loaded (0 to 360 degrees),
over `milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L15)

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

### set_rotate_counter_clockwise

```rust
fn set_rotate_counter_clockwise(element: &Control, milliseconds: f64)
```

Applies a counter-clockwise rotation animation to the element when loaded (0 to -360
degrees), over `milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L25)

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

### set_rotate_in

```rust
fn set_rotate_in(element: &Control, milliseconds: f64)
```

Applies a rotate-in animation to the element when loaded (from -180 to 0 degrees), over
`milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L35)

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

### set_rotate_out

```rust
fn set_rotate_out(element: &Control, milliseconds: f64)
```

Applies a rotate-out animation to the element when loaded (from 0 to 180 degrees), over
`milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L45)

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

### set_flip

```rust
fn set_flip(element: &Control, milliseconds: f64)
```

Applies a flip animation to the element when loaded (180 degree rotation), over
`milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L55)

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

### set_swing

```rust
fn set_swing(element: &Control, milliseconds: f64)
```

Applies a swing animation to the element when loaded (back and forth rotation), over
`milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L65)

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

### set_custom_rotate

```rust
fn set_custom_rotate(element: &Control, from_angle: f64, to_angle: f64, milliseconds: f64)
```

Applies a custom rotation animation to the element when loaded: from `from_angle` to
`to_angle` degrees, over `milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/rotate_animation.rs#L75)

## Trait implementations

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

## Availability

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