c++ - cocos2d-x ver3 action blink in Sequence doesn't executes , single action does -
i have strange situation try run blink action part of sequence on sprites although method getnumberofrunningactions returns 1 sprite dosn't blink.
where pmatchedsymbolarray array of reelsymbol sprite extendet class
class reelsymbol :public sprite { public: create_func(reelsymbol); reelsymbol(); virtual bool init(); void setup(); static reelsymbol* createwithspriteframename(const std::string& spriteframename); private: int getintfromname(std::string key); settings* psettings; }; for(ssize_t a=0; a<pmatchedsymbolarray->count();a++) { auto actionblink = blink::create(2, 5); auto repeat = repeat::create(actionblink, 2); reelsymbol* symbol = ((reelsymbol*)pmatchedsymbolarray->getobjectatindex(a)); auto actionsequence = sequence::create( actionblink, delaytime::create(2), callfunc::create( std::bind(&linesmanager::animationunitcallback, this, symbol,pmatchedsymbolarray->count()) ), null); reelsymbol* thisreelsymbol = ((reelsymbol*)pmatchedsymbolarray->getobjectatindex(a)); thisreelsymbol->runaction(actionsequence); int no = thisreelsymbol->getnumberofrunningactions(); cclog("getnumberofrunningactions: %d",no); } void linesmanager::animationunitcallback(node* sender,int imatchedsymbolarraycount) { }
the sprite blink if run:
auto actionblink = blink::create(2, 5); .... .... thisreelsymbol->runaction(actionblink );
what can wrong here ?
if problem recent version workaround might using 2 actions simultaneously.
- blink action duration.
- sequence delay of blink action , followed other actions.
Comments
Post a Comment