• CCCallFunc和CCSequence


    class CC_DLL CCCallFunc : public CCActionInstant //<NSCopying>

    void Issue1305_2::onEnter()
    {
        ActionsDemo::onEnter();
        centerSprites(0);
    
        CCSprite *spr = CCSprite::create("Images/grossini.png");
        spr->setPosition(ccp(200,200));
        addChild(spr);
    
        CCMoveBy* act1 = CCMoveBy::create(2 ,ccp(0, 100));
        //CCCallFunc也是动作,可以放到动作序列里
        CCCallFunc* act2 = CCCallFunc::create(this, callfunc_selector(Issue1305_2::log1)) ;
        CCMoveBy* act3 = CCMoveBy::create(2, ccp(0, -100));
        CCCallFunc* act4 = CCCallFunc::create(this, callfunc_selector(Issue1305_2::log2)) ;
        CCMoveBy* act5 = CCMoveBy::create(2, ccp(100, -100));
        CCCallFunc* act6 = CCCallFunc::create(this, callfunc_selector(Issue1305_2::log3)) ;
        CCMoveBy* act7 = CCMoveBy::create(2, ccp(-100, 0));
        CCCallFunc* act8 = CCCallFunc::create(this, callfunc_selector(Issue1305_2::log4)) ;
    
        CCFiniteTimeAction* actF = CCSequence::create(act1, act2, act3, act4, act5, act6, act7, act8, NULL);
    
        //    [spr runAction:actF];
        CCDirector::sharedDirector()->getActionManager()->addAction(actF ,spr, false);
    
    }
    
    void Issue1305_2::log1()
    {
        CCLog("1st block");
    }
    
    void Issue1305_2::log2()
    {
        CCLog("2nd block");
    }
    
    void Issue1305_2::log3()
    {
        CCLog("3rd block");
    }
    
    void Issue1305_2::log4()
    {
        CCLog("4th block");
    }
  • 相关阅读:
    对react的context的研究
    react组件通信props属性传递
    react的组件的两种形式
    对react构造函数研究--------引用
    ReactRouter基本使用2
    ReactRouter基本使用1
    react生命周期
    对react进行研究----入门
    Nginx源码安装
    Vmware克隆linux6虚拟机后网络问题
  • 原文地址:https://www.cnblogs.com/newlist/p/3204189.html
Copyright © 2020-2023  润新知