The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Announcing Tweeny, an interpolation library
Leonardo


Joined: 11 Feb 2010
Posts: 46
Hello!

I am sending this to let you know about a new library called Tweeny. Its purpose is to provide tweening of values (i.e, interpolation between two values), to aid in animations of screen objects.

Tweening is commonly used when animating user interfaces to make them feel natural and neat. Things like fading in, size and rotation changes and many other effects are produced using some sort of tweening (start noticing how the UI of many AAA games are animated and you'll see).

Tweeny can also be used to create sprite animations with multi points and values: you can use the same tween to animate sets of values that can even be of different types (for instance, control sprite frame, position and rotation in the same tween).

This is a little example:

auto tween = tweeny::from(0).to(10).during(100);
tween.onStep([](int frame) { sprite.frame = frame; return false; });
while (tween.progress() < 1.0f) { tween.step(dt); }


See the examples folder in source for more samples.


Tweeny is a header-only library, which makes it easy to use. Just point your include path to it and #include "tweeny.h".


Links:

- Website: http://mobius3.github.io/tweeny
- API Doc: http://mobius3.github.io/tweeny/doc
- Manual: http://mobius3.github.io/tweeny/doc/manual.html
- Source: http://github.com/mobius3/tweeny
- Zombie demo: http://mobius3.github.io/tweeny/examples/sprite/sprite.html

Feedback is very much welcome. I hope this is useful to you.

Thanks for your attention!

Leonardo