xen-animation 0.1.2

a high-performance animation library for rust applications.
Documentation
  • Coverage
  • 100%
    21 out of 21 items documented0 out of 0 items with examples
  • Size
  • Source code size: 32.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 762.11 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • randseas

xen-animation

Latest version Downloads Rust Documentation Apache-2.0

A high-performance, framework-agnostic animation and transition library for Rust.

xen-animation provides a centralized animation system with CSS-compatible easing functions, transitions, interpolation, and frame-based animation management. It is designed to be reusable across GUI frameworks, game engines, real-time applications, and custom renderers.

Callers never own a timer themselves - they only report their current target value every frame through [AnimationManager::set_target], and the manager owns the entire lifecycle: starting, easing, retargeting mid-flight, and settling once the transition finishes.

Features

  • CSS-compatible cubic-bezier easing
  • Built-in easing presets (linear, ease-in, ease-out, ease-in-out)
  • Custom cubic-bezier curves
  • Centralized AnimationManager, generic over any hashable key type
  • Multiple concurrent, independently keyed animations
  • Duration, delay, and per-property transition overrides
  • Zero rendering dependencies

Example

use std::time::Duration;
use xen_animation::{AnimationManager, AnimValue, Easing, Transition};

#[derive(Clone, Copy, PartialEq, Eq, Hash)]
enum AnimKey {
    Opacity,
}

fn main() {
    let mut manager: AnimationManager<AnimKey> = AnimationManager::new();
    let transition = Transition::new(Duration::from_millis(300)).easing(Easing::EaseOut);

    // Start animating opacity towards 1.0 using the given transition.
    manager.set_target(AnimKey::Opacity, AnimValue([1.0, 0.0, 0.0, 0.0]), Some(transition));

    // A typical render loop: advance the manager once per frame, then read
    // back the (possibly mid-transition) current value.
    for _ in 0..5 {
        manager.tick(Duration::from_millis(16));

        if let Some(value) = manager.value(AnimKey::Opacity) {
            println!("opacity = {:.3}", value.0[0]);
        }
    }

    println!("still animating: {}", manager.is_animating());
}

Installation

Cargo.toml

[dependencies]

xen-animation = "0.1.2"

License

Apache License 2.0 © 2026 randseas. See LICENSE for details.