How to call a void function inside the sequence?

Cocos2d-x v3
  • nightrobin
    Likes 0

    Problem Description

    Good day,

    I have this:

    void TheClass:Method1()
    {
        cocos2d::MoveBy* moveAction = cocos2d::MoveBy::create( 3, cocos2d::Vec2( 0, 10 ) );
        cocos2d::Sequence* theSequence = cocos2d::Sequence::create(moveAction, TheClass:Method2, nullptr);
        someSprite->runAction(theSequence);
    }
    void TheClass:Method2()
    {
        // run some code
    }

    Why can't I run this?

    I am using coco2d-x ver 3.8.

    Thank you smile

  • nightrobin
    Likes 0

    Thanks.

    It solved my problem. I also used the test codes from test/test-cpp of cocos2d-x folder.


  • Sonar Systems admin
    Likes 0

    Great to hear mate, feel free to post anymore questions you may have.

Login to reply