Skip to content

AzariasB/libtwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

libtwin

C++ light tweening library

Basic Usage

//create a twin object, that will start from 0 and go to 100
// in 10 units of time
// using the bounceIn easing function
auto t = twin::makeTwin(0,100, 10, twin::easing::bounceIn);

//advance the tweening by one unit of time
t.step(1);

// gets the current value
int currentValue = t.get();

//gets the current progress (0 = begining, 1 = finished)
float currentProgress = t.progress();

Advanced usage

/*
creates a twin object, with a callback
this function will be called when the tweening
is over, the function takes no parameters
*/
auto t = twin::makeTwin(0,100, 0.1f, twin::easing::liear,[](){
    std::cout << "It's over !\n";
});

//reach the end, and look at the function getting called
t.step(0.1f);

About

C++ tweening library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages