Open RogerGMartins opened 10 years ago
use time instead of frames to do the calculations, with the map functions:
ofxTween::map(ofGetElapsedTimef(),initTme,endTime,initValue,endValue,clamp,ofxTweenEaseLinear());
where initTime, endTime are the times at which your animation started and should end and initValue, endValue the values you'll use for animation, so for example if you want to do an animation of something moving from the left to right in the screen that takes 1 second:
endTime = initTime + 1;
initValue = 0;
endValue = ofGetWidth()
ofxTween::map(ofGetElapsedTimef()-initTime,initTme,endTime,initValue,endValue,clamp,ofxTweenEaseLinear());
where you fix initTime at some point to the current ofGetElapsedTimef()
very cool, thanks alot mate
Hello, how would one turn the tweens framerate independent?