/ofxTweeny

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

Primary LanguageC++

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