2 releases
0.1.1 | Feb 12, 2022 |
---|---|
0.1.0 | Feb 11, 2022 |
#900 in Math
27 downloads per month
7KB
126 lines
ezy
Ezy
Rust eazy to use tweening library
Tweens are created separate from instantiation, which fixes the jump at the start if the tween start does not match the current value.
The trait Lerp describes how a value is interpolated.
If feature glam
is enabled, Lerp
is available for Vec and Quat (using Slerp)
Example
use std::time::Duration;
use ezy::*;
let mut val = 0.0;
// Go to `1.0` under 2 seconds
let tween = Tween::new(1.0, Duration::from_secs(2))
let mut anim = tween.start(val);
// Update tween
anim.progress(&mut val, Duration::from_millis(200))
License: MIT
lib.rs
:
Ezy
Rust eazy to use tweening library
Tweens are created separate from instantiation, which fixes the jump at the start if the tween start does not match the current value.
The trait Lerp describes how a value is interpolated.
If feature glam
is enabled, Lerp
is available for Vec and Quat (using Slerp)
Example
use std::time::Duration;
use ezy::*;
let mut val = 0.0;
// Go to `1.0` under 2 seconds
let tween = Tween::new(1.0, Duration::from_secs(2));
let mut anim = tween.start(val);
// Update tween
anim.progress(&mut val, Duration::from_millis(200));
Dependencies
~0–740KB
~22K SLoC