• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cmake/H02-Aug-2019-144125

doc/H03-May-2022-2,8412,210

include/H02-Aug-2019-2,3691,084

.gitignoreH A D02-Aug-201920 32

CHANGELOG.mdH A D02-Aug-2019553 1714

LICENSEH A D02-Aug-20191.1 KiB2217

README.mdH A D02-Aug-20193.5 KiB7751

README.md

1# Tweeny
2
3Tweeny 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.
4
5The goal of Tweeny is to provide means to create fluid interpolations when animating position, scale, rotation, frames or other values of screen objects, by setting their values as the tween starting point and then, after each tween step, plugging back the result.
6
7**It features**:
8
9- A descriptive and (hopefully) intuitive API,
10- 30+ easing functions,
11- Allows custom easing functions,
12- Multi-point tweening,
13- Simultaneous tween of heterogeneous value sets,
14- Timeline-like usage (allows seeking to any point),
15- Header-only
16- Zero external dependencies
17- Steps forwards or backwards :)
18- Accepts lambdas, functors and functions as step and seek callbacks
19
20**Obligatory hello world example**:
21
22Linearly interpolate character by character from the word *hello* to *world* in `50` steps:
23
24```cpp
25auto helloworld = tweeny::from('h','e','l','l','o').to('w','o','r','l','d').during(50);
26for (int i = 0; i < 50; i++) {
27    for (char c : helloworld.step(1)) { printf("%c", c); }
28    printf("\n");
29}
30```
31
32Relevant code:
33
34- **1**: create the tween instance starting with characters of the `hello` word, adds a tween target with the chars of the `world` word and specify it should reach it in `50` steps.
35- **3**: move the tween forward by one step. Use the return value of it (which ill be a `std::array<char, 5>` in this case) to set up a for loop iterating in each char, printing it.
36
37## Installation methods:
38
39**Using your package manager**
40
41There are some packages for tweeny made by some great people. Repology has a list of them and their versions [here](https://repology.org/metapackage/tweeny/versions). Thanks, great people!
42
43**Not installing it**
44
45You just need to adjust your include path to point to the `include/` folder after you've cloned this repository.
46
47**Copying the `include` folder:**
48
49Tweeny itself is a header only library. You can copy the `include/` folder into your project folder and then include from it: `#include "tweeny/tweeny.h"`
50
51**CMake subproject**
52
53This is useful if you are using CMake already. Copy the whole tweeny project and include it in a top-level `CMakeLists.txt` file and then use `target_link_libraries` to add it to your target:
54
55```
56add_subdirectory(tweeny)
57target_link_libraries(yourtarget tweeny)
58```
59This will add the `include/` folder to your search path, and you can `#include "tweeny.h"`.
60
61## Doxygen documentation
62
63This library is documented using Doxygen. If you intend to generate docs, specify the flag `TWEENY_BUILD_DOCUMENTATION` when generating CMake build files (e.g: `cmake .. -DTWEENY_BUILD_DOCUMENTATION=1`). You will need doxygen installed.
64
65## Contributing
66
67Tweeny is open-source, meaning that it is open to modifications and contrubutions from the community (you are very much encouraged to do so!). However, we'd appreciate if you follow these guidelines:
68
69- Don't use `PascalCase` nor `snake_case` in names
70- Use `camelCase`, but try to avoid multi word names as hard as possible
71- Document code using Doxygen
72- Implementation details should go inside `tweeny::detail` namespace.
73- Template implementations should go into a `.tcc` file
74
75## Examples:
76
77Demo code showcasing some of Tweeny features can be seen in the [tweeny-demo](https://github.com/mobius3/tweeny-demos) repository. This repository also has instructions on how to build them.