Skip to content

iwoithe/IwTween

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

IwTween

A minimal header-only C++ tween library

Example Usage

#include <iostream>

#include "iwtween.h"

int main()
{
    // Create a tween between 0 and 100
    iw::Tween<float> tween{ 0.0f, 100.0f };

    bool isRunning = true;
    while (isRunning) {
        // Calculate delta time here

        // Increase the tween's alpha by delta time
        tween.addAlpha(deltaTime);

        // Print current value of the tween using a different interpolation
        std::cout << tween.currentValue(iw::Tween<float>::easeInCubicInterp) << std::endl;

        if (tween.alpha() >= 1.0f)
            // Tween finished
            isRunning = false;
    }

    return 0;
}

Features

  • Header-only
  • No external dependencies (only depends on standard libary)
  • Supports every type which implements +, - and *
  • Doesn't run its own loop, use your existing app/game loop
  • Various interpolation methods
    • Feel free to contribute more as many interpolation methods are currently missing!

Documentation

For now look at documentation in iwtween.h

Contributing

I will update this library as I need for personal projects, however, contributions are very welcome!

License

IwTween is released under the MIT license. See LICENSE for more details

About

A minimal header-only C++ tween library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages