ofxTweener

It seems that there are a lot of different tweener users, each with his or her specific dimands. Since i have an ActionScript 3 background, i am used to work a lot with Tweener and TweenMax. The tween classes for open frameworks i found so far didn’t fit my needs at al, so i wrote my own class.

features:

  • single static class, one tween class to control them all

  • central update() function can be called from within the draw function for visual sync tweening

  • reference variables, no need to update

  • delayed calls

  • central time scaling

  • stop/remove all or individual tweens

  • override or sequence mode

  • bezier tweening

Some information can be found on the site http://www.hautetechnique.com/ofxtweener

or you can grab the source at GitHub https://github.com/hautetechnique/ofxTweener

Sample line of code:

  
Tweener.addTween(position.x, 1000, 5, &ofxTransitions::easeOutElastic);  

Currently the project is still work in progress, so if you have any comments, let me know!

Hi sander,

a big Thank You for creating this highly useful tweening tool! Keep up the good work!
I downloaded the source & example and find it very comprehensive to start with. The ultimate feature to come is of course some kind of notification of when a tween has finished. Do you have plans to implement this?

That said, while playing around with ofxTweener I also ran into some issues on which I’d like to hear your opinion:

I created a simple class of which an instance is created (an image is drawn to the canvas) for every mouse click. My idea was to have the images scale up during the first 3 seconds after creation.

1.) When I call » Tweener.addTween(tweenVal, 100, 3);« in the constructor and then output »tweenVal« to the console in every update cycle (the update method of my class), tweenVal takes absurd values like 2.70917e-29 instead of having been initialized as »float tweenVal = 1;« and never changes.

2.) To work around issue #1 I placed the addTween call in the classes update method, calling it only one time. This works as supposed until I create more than one instance of my custom class. In this case all variables passed to Tweener take either the values 0, 1 or a random number as 6.51777e-27.

I can provide an example project if necessary to illustrate the above mentioned problems, but figured it might be easier to start with just describing the situation as we are not dealing with abstract or complex scenarios here.

Hi mcFreaq,

thnx!

Please provide some examples so i can see what’s going on.