Skip to content

A port of the action system used by Cocos2dx to openFrameworks

License

Notifications You must be signed in to change notification settings

Furkanzmc/ofxActionManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ofxActionManager

ofxActionManager is a port of the action system used by Cocos2dx. The usage is pretty much the same as Cocos2dx. The only difference is All the actions work on ActionTarget so you need to use that, or inherit it for Actions. You can read about actions here

ofApp.h =>
class ofApp : public ofBaseApp{

	public:
		...

		ActionTarget target;
};

ofApp.cpp =>
void ofApp::update()
{
    const float delta = ofGetLastFrameTime();
    ActionManager::getInstance()->updateActions(delta);
}

void ofApp::draw()
{
    ofCircle(target.getPosition(), 20);
}

void ofApp::mouseReleased(int x, int y, int button)
{
    auto seq = Sequence::create(EaseBounceOut::create(MoveTo::create(1, ofVec2f(x, y))), CallFunc::create([]() {
            std::cout << "Hey Sequence!\n";
        }), nullptr);
    target.runAction(seq);
}

Available Actions in ofxActionManager

Interval Actions

  • Sequence
  • Repeat
  • RepeatForever
  • Spawn
  • RotateTo
  • RotateBy
  • MoveBy
  • MoveTo
  • SkewTo
  • SkewBy
  • JumpBy
  • JumpTo
  • BezierBy
  • BezierTo
  • ScaleTo
  • ScaleBy
  • Blink
  • FadeTo
  • FadeIn
  • FadeOut
  • TintTo
  • TintBy
  • DelayTime
  • ReverseTime
  • Animate
  • TargetedAction
  • ActionFloat
  • ActionVec3
  • ActionVec4

Instant Actions

  • Show
  • Hide
  • ToggleVisibility
  • RemoveSelf
  • FlipX
  • FlipY
  • Place
  • CallFunc
  • CallFuncN

Easing Actions

  • EaseExponentialInOut
  • EaseExponentialOut
  • EaseIn
  • EaseInOut
  • EaseOut
  • EaseQuadratic
  • EaseQuartic
  • EaseQuintic
  • EaseSineIn
  • EaseSineInOut
  • EaseSineOut
  • EaseBack
  • EaseBezierAction
  • EaseBounce
  • EaseCircle
  • EaseCubic
  • EaseElastic
  • EaseExponentialIn

About

A port of the action system used by Cocos2dx to openFrameworks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages