Skip to content

Make a value animation with keyframes and easing function.

Notifications You must be signed in to change notification settings

igorsegallafa/value-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Value Animation

Make a value animation with keyframes and easing function.

Dependencies

  • Functional C++ STD Library
  • Vector C++ STD Library

Usage

Including library

First of all, you will need to include this library into your project. For this, you just need to include "ValueAnimation.h" file.

Updating Animation

Call the function Update(float timeElapsed) specifying the time elapsed since last frame (in milliseconds). Update() function will return the current value of animation.

Examples

auto valueAnimation = Delta3D::Math::ValueAnimation<int>();
valueAnimation.From( 0 ).To( 100 ).During( 500 ).Ease( Delta3D::Math::Easing::BounceIn ); //from 0 to 100 during 500ms using bounce in easing
valueAnimation.To( 200 ).During( 1000 ); //from 100 (last value) to 200 during 1000ms using linear easing (default)
valueAnimation.To( 300 ).During( 2000 ); //from 200 (last value) to 300 during 2000ms using linear easing (default)
auto valueAnimation = Delta3D::Math::ValueAnimation<float>();
valueAnimation.SetLoop( true ); //put animation in loop
valueAnimation.SetKeyFrame( 0.f, 0.f, Delta3D::Math::Easing::Linear ); //set keyframe on time 0.0ms with value 0.0
valueAnimation.SetKeyFrame( 1000.f, 10.f, Delta3D::Math::Easing::BackIn ); //set keyframe on time 1000ms with value 10.0 using back in easing
valueAnimation.SetKeyFrame( 3000.f, 35.f, Delta3D::Math::Easing::QuadOut ); //set keyframe on time 3000ms with value 35.0 using quadOut in easing

Documentation

How the library is very simple, have not a documentation generated by Doxygen, but the code comments are already supported to do this.

Credits

About

Make a value animation with keyframes and easing function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages