interpolated
Generic, smooth value interpolation and easing functions for Rust.
Features
- Animate any
T: Copy + Add + Sub + Mul<f32>over time - Configurable duration and easing function per interpolation
- Built-in easing functions:
none(instant jump)linearease_in_out_expoease_out_backease_in_backease_out_elastic
Installation
Add to your Cargo.toml:
[]
= "0.1.2"
Or via the command line:
Quick Start
use ;
use Duration;
API Overview
struct Interpolated<T>
new(initial: T) -> Selfset_duration(&mut self, duration: Duration)pub transition: fn(f32) -> f32set(&mut self, new_end: T)value(&self) -> Tis_finished(&self) -> bool
Easing Functions
use ;
Each function has the signature fn(f32) -> f32, mapping t ∈ [0,1] to an eased ratio.
For full docs, see https://docs.rs/interpolated
License
Licensed under:
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)