Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emomaxd/twease

Twease is a header only C++ library designed to provide utilities for animation, tweening, and easing functions.
https://github.com/emomaxd/twease

animation c-plus-plus header-only tweening

Last synced: 15 days ago
JSON representation

Twease is a header only C++ library designed to provide utilities for animation, tweening, and easing functions.

Awesome Lists containing this project

README

        

Twease Library
===============

Overview
--------
Twease is a header only C++ library designed to provide utilities for animation, tweening, and easing functions. It facilitates smooth transitions between values and can be integrated into various applications requiring dynamic value changes over time.

To see easing functions as visually check [Twease-Visualizer](https://github.com/EmomaxD/TweaseVisualizer) out!

Features
--------
1. **Tweening**: Interpolate between sequences of values over a specified duration.
2. **Easing Functions**: Provide various easing functions (e.g., linear, quadratic, cubic) for smooth animations.
3. **Animation**: Transition smoothly between different states or values.
4. **Customizable**: Easily integrate into existing C++ projects with customizable interpolation methods and easing functions.

Animation example:
--------
```cpp
#include
#include

#include "Twease/Twease.h"

int main() {

double deltaTime = 0.016; // 60 FPS


auto anim = Twease::Animation::animate(0.0, 100.0).during(2.0).easing(Twease::cubicIn);

while (!anim.isCompleted()) {
anim.update(deltaTime);
std::cout << "Current value: " << anim.getCurrentValue() << std::endl;
}

return 0;
}
```
Tweening example:
--------
```cpp
#include
#include

#include "Twease/Twease.h"

int main() {

auto helloworld = Twease::Tween({ 'h', 'e', 'l', 'l', 'o' })
.to({ 'w', 'o', 'r', 'l', 'd' })
.during(50);

for (int i = 0; i <= helloworld.during(); ++i) {
std::vector interpolatedSequence = helloworld.step(static_cast(i) / helloworld.during());

for (char c : interpolatedSequence)
std::cout << c;

std::cout << std::endl;
}

return 0;
}
```