# Bevy UI Animation [![Rust](https://img.shields.io/badge/rust-v1.59.0-0e7261?style=for-the-badge&logo=rust&logoColor=fff&labelColor=2a3438)](https://www.rust-lang.org) [![Crate](https://img.shields.io/crates/v/bevy_ui_animation?style=for-the-badge&&logo=rust&logoColor=fff&labelColor=2a3438&label=Crate&color=a72144)](https://crates.io/crates/bevy_ui_animation) [![Docrs](https://img.shields.io/docsrs/bevy_ui_animation?style=for-the-badge&&logo=rust&logoColor=fff&labelColor=2a3438&label=Docrs)](https://docs.rs/bevy_ui_animation) [![Bevy](https://img.shields.io/crates/v/bevy?style=for-the-badge&labelColor=2a3438&color=855667&label=Bevy)](https://bevyengine.org) A [GSAP-like](https://greensock.com/gsap) animation plugin for Bevy UI. ## 🌌 Features - ✅ Animate NodeBundle, ImageBundle, TextBundle, ButtonBundle - 🚧 Timeline support - 🚧 Bevy event support ## 🔮 Usage To use this plugin, the first step is to add a dependency to your `Cargo.toml`: ```toml [dependencies] bevy_ui_animation = "1.0.0" ``` Add the `AnimationPlugin` to your `main.rs`: ```rust use bevy::prelude::*; use bevy_ui_animation::*; App::new() .add_plugins(DefaultPlugins) .add_plugin(AnimationPlugin) .run(); ``` Animate a bundle: ```rust use bevy::prelude::*; use bevy_ui_animation::*; fn setup(mut commands: Commands) { commands.spawn_bundle(UiCameraBundle::default()); commands .spawn_bundle(NodeBundle { style: Style { size: Size::new(Val::Percent(100.0), Val::Percent(100.0)), ..Default::default() }, color: UiColor(Color::BLUE), transform: Transform::default(), ..Default::default() }) .insert(Animation::new(Vars { style: Some(Style { size: Size::new(Val::Percent(50.0), Val::Percent(50.0)), ..Default::default() }), color: Some(UiColor(Color::RED)), transform: Some(Transform::from_rotation(Quat::from_rotation_z( 180_f32.to_radians(), ))), duration: 2.0, ease: Ease::ExpoOut, repeat: true, yoyo: true, ..Default::default() })); } ``` Preview: ![preview](https://github.com/miZyind/bevy_ui_animation/blob/master/examples/all.gif) You can directly run this example by: ```bash cargo run --example all --features="bevy/bevy_winit" ``` ## ✳️ Vars | Field | Type | Default | Description | | ------------------ | --------------------------- | --------- | --------------------------------------------------------------------------- | | style | `Option