tweener is a one-dimensional tweening library.
Features
- 41 easing functions
- Optional
serdefeature enables serialization and deserialization of theTweenstruct (useful for games). Enable it inCargo.tomlwithfeatures = ["serde"]. - Yoyo animation feature
- Animation durations use the
std::time::Durationtype (easy-to-read code). - The
f32submodule can be used for the f32Tweentype.use tweener::f32::*;
Quick start
use Duration;
use ;
Easing functions
| family | in | out | inOut | outIn |
|---|---|---|---|---|
| Linear | Linear | Linear | Linear | Linear |
| Quad | InQuad | OutQuad | InOutQuad | OutInQuad |
| Cubic | InCubic | OutCubic | InOutCubic | OutInCubic |
| Quart | InQuart | OutQuart | InOutQuart | OutInQuart |
| Quint | InQuint | OutQuint | InOutQuint | OutInQuint |
| Expo | InExpo | OutExpo | InOutExpo | OutInExpo |
| Sine | InSine | OutSine | InOutSine | OutInSine |
| Circ | InCirc | OutCirc | InOutCirc | OutInCirc |
| Back | InBack | OutBack | InOutBack | OutInBack |
| Bounce | InBounce | OutBounce | InOutBounce | OutInBounce |
| Elastic | InElastic | OutElastic | InOutElastic | OutInElastic |
See easings.net for online visualization.