Giter VIP home page Giter VIP logo

tweeny's Introduction

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.

The 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.

It features:

  • A descriptive and (hopefully) intuitive API,
  • 30+ easing functions,
  • Allows custom easing functions,
  • Multi-point tweening,
  • Simultaneous tween of heterogeneous value sets,
  • Timeline-like usage (allows seeking to any point),
  • Header-only
  • Zero external dependencies
  • Steps forwards or backwards :)
  • Accepts lambdas, functors and functions as step and seek callbacks

Obligatory hello world example:

auto helloworld = tweeny::from('h','e', 'l', 'l', 'o').to('w', 'o', 'r', 'l', 'd').during(50);
for (int i = 0; i < 50; i++) {
    for (char c : helloworld.step(1)) { printf("%c", c); }
    printf("\n");
}

Examples:

Some examples can be seen in the examples folder. They need to be built if you want to see them in action. To do this, I recommed creating a build folder inside the project folder building it from there.

Disclaimer: the sprite example needs SDL2 to build

Linux, MacOS and Unix

From the top level directory of tweeny:

mkdir build && cd build
cmake ..
make

Windows

  • Open CMake GUI and select the top level directory of tweeny as source
  • Select or create a build folder (it can be inside of tweeny)
  • Select the generator (depending on your compiler/IDE)
  • Click GENERATE
  • Open the generated project in your IDE, select the target and run it from there.

Installation methods:

You just need to adjust your include path to point to the include/ folder.

Copying the include folder:

Tweeny itself is a header only library. The easiest way to use it is to copy the include/ folder into your project folder and then include from it: #include "tweeny/tweeny.h"

CMake subproject

This 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:

add_subdirectory(tweeny)
target_link_libraries(yourtarget tweeny)

This will add the include/ folder to your search path, and you can #include "tweeny.h".

Contributing

Tweeny 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:

  • Don't use PascalCase nor snake_case in names
  • Use camelCase, but try to avoid multi word names as hard as possible
  • Document code using Doxygen
  • Implementation details should go inside tweeny::detail namespace.
  • Template implementations should go into a .tcc file

Analytics

tweeny's People

Contributors

mobius3 avatar balletie avatar

Watchers

MatrixAlgerbra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.