zoukankan      html  css  js  c++  java
  • CCToggleVisibility和CCPlace

        CCActionInterval*  move1 = CCMoveBy::create(1, ccp(250,0));
        CCActionInterval*  move2 = CCMoveBy::create(1, ccp(0,50));
        CCToggleVisibility*  tog1 = new CCToggleVisibility();
        CCToggleVisibility*  tog2 = new CCToggleVisibility();
        tog1->autorelease();
        tog2->autorelease();
        //目前的理解是夹在tog1和tog2间的move2将不显示中间的过渡动作,
       //动作的时间到了之后精灵就直接显示在动作的结果位置
        CCFiniteTimeAction*  seq = CCSequence::create( move1, tog1, move2, tog2, move1->reverse(), NULL);
        CCActionInterval*  action = CCRepeat::create((CCActionInterval*)(CCSequence::create( seq, seq->reverse(), NULL)), 3);
    void ActionRepeat::onEnter()
    {
        ActionsDemo::onEnter();
    
        alignSpritesLeft(2);
    
    
        CCActionInterval*  a1 = CCMoveBy::create(1, ccp(150,0));
        CCActionInterval*  action1 = CCRepeat::create(
            //动作组:先在(60,60)位置显示,然后执行动作a1
            //对该动作组重复执行3次
            CCSequence::create( CCPlace::create(ccp(60,60)), a1, NULL) , 
            3); 
        CCAction*  action2 = CCRepeatForever::create(
            (CCActionInterval*)(CCSequence::create((CCActionInterval*)(a1->copy()->autorelease()), a1->reverse(), NULL))
            );
    
        m_kathia->runAction(action1);
        m_tamara->runAction(action2);
    }
  • 相关阅读:
    Elasticsearch 检索
    Elasticsearch 基本操作
    Elasticsearch 集群
    Elasticsearch 插件head和kibana
    Elasticsearch 安装
    CentOS 安装JDK
    前端登录密码加密传输
    springboot2.0 快速集成kafka
    原来自定义模型绑定器还可以这么玩
    Value cannot be null or empty. 参数名: contentPath
  • 原文地址:https://www.cnblogs.com/newlist/p/3204063.html
Copyright © 2011-2022 走看看