Quantcast
Channel: D2D1Renderer Wiki Rss Feed
Viewing all articles
Browse latest Browse all 20

Updated Wiki: Animate

$
0
0

Animate

#include "Utility\Tweener\Tweener.h"

tween::Tweener _tweener;
int counter = 0;

void TweenTest::CreateTween() {
    tween::TweenerParam param(5000);
    param.addProperty(&_displayObject->_x, 200);
    param.addProperty(&_displayObject->_y, 500);

    _tweener.addTween(param);

        _tweener.addEventListener("ON_START", std::bind(&TweenTest::ON_START_tweener, this, std::placeholders::_1));

        _tweener.addEventListener("ON_COMPLETE", std::bind(&TweenTest::ON_COMPLETE_tweener, this, std::placeholders::_1));

        _tweener.addEventListener("ON_STEP", std::bind(&TweenTest::ON_STEP_tweener, this, std::placeholders::_1));
}

void TweenTest::UpdateTween() {
    _tweener.step(counter );
    counter  += 1;
}

void TweenTest::ON_START_tweener(const Event &e) {
    //called if tween has started
}

void TweenTest::ON_STEP_tweener(const Event &e) {
    //called if tween has made a step
}

void TweenTest::ON_COMPLETE_tweener(const Event &e) {
    //called if tween is finished
}

Viewing all articles
Browse latest Browse all 20

Latest Images

Trending Articles





Latest Images