zoukankan      html  css  js  c++  java
  • 粒子加到骨骼中

    CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfoAsync("armature/robot.png", "armature/robot.plist", "armature/robot.xml", this, NULL);
    CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfoAsync("armature/hero.ExportJson", this, NULL);
    
    void TestParticleDisplay::onEnter()
    {
        ArmatureTestLayer::onEnter();
        setTouchEnabled(true);
    
        animationID = 0;
    
        armature = cocos2d::extension::CCArmature::create("robot");
        armature->getAnimation()->playWithIndex(0);
        armature->setPosition(VisibleRect::center());
        armature->setScale(0.48f);
        armature->getAnimation()->setSpeedScale(0.5f);
        addChild(armature);
    
    
        CCParticleSystem *p1 = CCParticleSystemQuad::create("Particles/SmallSun.plist");
        CCParticleSystem *p2 = CCParticleSystemQuad::create("Particles/SmallSun.plist");
    
        cocos2d::extension::CCBone *bone  = cocos2d::extension::CCBone::create("p1");
        bone->addDisplay(p1, 0);
        bone->changeDisplayWithIndex(0, true);
        bone->setIgnoreMovementBoneData(true);
        bone->setZOrder(100);
        bone->setScale(1.2f);
        armature->addBone(bone, "bady-a3");
    
        bone  = cocos2d::extension::CCBone::create("p2");
        bone->addDisplay(p2, 0);
        bone->changeDisplayWithIndex(0, true);
        bone->setIgnoreMovementBoneData(true);
        bone->setZOrder(100);
        bone->setScale(1.2f);
        armature->addBone(bone, "bady-a30");
    }
    
    bool TestParticleDisplay::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
    {
        ++animationID;
        animationID = animationID % armature->getAnimation()->getMovementCount();
        armature->getAnimation()->playWithIndex(animationID);
        return false;
    }
  • 相关阅读:
    Nginx负载均衡+代理+ssl+压力测试
    Nginx配置文件详解
    HDU ACM 1690 Bus System (SPFA)
    HDU ACM 1224 Free DIY Tour (SPFA)
    HDU ACM 1869 六度分离(Floyd)
    HDU ACM 2066 一个人的旅行
    HDU ACM 3790 最短路径问题
    HDU ACM 1879 继续畅通工程
    HDU ACM 1856 More is better(并查集)
    HDU ACM 1325 / POJ 1308 Is It A Tree?
  • 原文地址:https://www.cnblogs.com/newlist/p/3607997.html
Copyright © 2011-2022 走看看