Header-only · C++17 · Zero dependencies

Tweeny

The modern C++ tweening library

Tweeny is an inbetweening library for creating complex animations in games and other interactive software. It provides a type-safe, fluent API for interpolating any value that supports arithmetic operations.

Set your starting values, step the tween each frame, and plug the result back into your object, whether you are animating position, scale, rotation, color, or something else entirely.

Quick example

#include <tweeny/tweeny.h>

auto tween = tweeny::from(0.0f)
                 .to(100.0f)
                 .via(tweeny::easing::circularInOut)
                 .during(60U)
                 .build();

tween.on(tweeny::event::step, [](auto& t) {
    printf("%.1f\n", t.peek());
    return tweeny::event::response::ok;
});

while (tween.progress() < 1.0f) {
    tween.step(1);
}