← Back

ofxTweeny

github.com/RyoYumo/ofxTweeny · @RyoYumo
OF 0.11 Animation

A wrapper of tweeny (https://github.com/mobius3/tweeny) for oF.

5 1 Last commit 5y ago Created 6y ago

README

ofxTweeny



Description

ofxTweeny is a wrapper of Tweeny for openFrameworks.

Install

git clone --recursive https://github.com/RyoYumo/ofxTweeny.git


How to use



!!! You must call ``ofxTweeny::Tweener::update()` in `ofApp::update()`` !!!

void ofApp::update() {
    ofxTweeny::Tweener::update();
}


Example



Simple example
float value = 0.0;
void ofApp::keyPressed(int key) {
    float from = value;
    float to = ofRandomf();
    int duration = 1000; // ms
    ofxTweeny::Tweener::add(&value, from, to, duration);
}


Customize animation curve
float value = 0.0;
void ofApp::keyPressed(int key) {
    float from = value;
    float to = ofRandomf();
    int duration = 1000; // ms
    ofxTweeny::Tweener::add(&value, from, to, duration, ofxTweeny::easeOutCirc);
}
Ease functions

Get this addon

HTTPS
SSH