Tweeny
Tweeny is an inbetweening library designed for the creation of complex animations for games and other beautiful interactive software. It leverages features of modern C++ to empower developers with an intuitive API for declaring tweenings of any type of value, as long as they support arithmetic operations.
This document contains Tweeny's API reference. The most interesting parts are:
- The Fine Tweeny Manual
- The tweeny::from global function, to start a new tween.
- The tweeny::tween class itself, that has all the interesting methods for a tween.
- The modules page has a list of type of easings.
This is how the API looks like:
#include "tweeny.h"
using tweeny::easing;
int main() {
// steps 1% each iteration
auto tween = tweeny::from(0).to(100).during(100).via(easing::linear);
// a tween with multiple values
auto tween2 = tweeny::from(0, 1.0f).to(1200, 7.0f).during(1000).via(easing::backInOut, easing::linear);
// a tween with multiple points, different easings and durations
auto tween3 = tweeny::from(0, 0)
.to(100, 100).during(100).via(easing::backOut, easing::backOut)
.to(200, 200).during(500).via(easing::linear);
return 0;
}
Examples
- Easings example prints on the console the easing curve for each easing function.
- Loop example provides an example on how to make a tween loop
- Sprite animation example holds a sprite animation example using two tweens.
Useful links and references