cocos2d-x 粒子动作 setTexture

        CCSize s = CCDirector::sharedDirector()->getWinSize();
        CCNode* explosion = CCParticleSun::create();
        ((CCParticleSun*)explosion)->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
        explosion->setPosition( ccp(s.width/2, s.height/2) );
        addChild(explosion);
        explosion->runAction( CCRepeatForever::create(
            (CCActionInterval *)CCSequence::create(CCMoveTo::create(0.5f,ccp(100,100)),CCMoveTo::create(0.5f,ccp(300,300)),
            CCMoveTo::create(0.5f,ccp(100,300)),
            NULL)));

 

你可能感兴趣的:(cocos2d-x)