Cocos2d iphone 为cocos2d-x创建自己的粒子系统

Cocos2d iphone 为cocos2d-x创建自己的粒子系统,cocos2d-iphone,textures,cocos2d-x,cocos2d-x-3.0,particle-system,Cocos2d Iphone,Textures,Cocos2d X,Cocos2d X 3.0,Particle System,我决定创建自己的粒子系统,因为我的客户对视觉性能有特定的期望。我选择了标准体系结构,一类是包含粒子的ParticleSystem,第二类是包含处理粒子方法的ParticleElement。但是,现在我已经让“ParticleElement”类成为了Sprite的heritor,但我很确定这是错误的解决方案)所以,我的问题是-你建议如何为Particle构建类?我应该为继承选择什么cocos2d-x类?需要为视觉性能选择什么方式(渲染纹理)?我感谢你们的帮助 试试这个url。 它为您提供了粒子系统

我决定创建自己的粒子系统,因为我的客户对视觉性能有特定的期望。我选择了标准体系结构,一类是包含粒子的ParticleSystem,第二类是包含处理粒子方法的ParticleElement。但是,现在我已经让“ParticleElement”类成为了Sprite的heritor,但我很确定这是错误的解决方案)所以,我的问题是-你建议如何为Particle构建类?我应该为继承选择什么cocos2d-x类?需要为视觉性能选择什么方式(渲染纹理)?我感谢你们的帮助

试试这个url。 它为您提供了粒子系统的plist,您可以使用

_emitter = ParticleSystemQuad::create("Particles/SpinningPeas.plist");
_emitter->setTextureWithRect(Director::getInstance()->getTextureCache()->addImage("Images/particles.png"), Rect(0,0,32,32));
addChild(_emitter, 10);

谢谢你的回复。我看过这个网站,它真的很棒,但它不能给我我想要的。我需要粒子的“特殊行为”。我已经制作了它们,但现在我的粒子元素是单精灵,我想这听起来不利于优化。所以我想知道如何使ParticleElement类对应用程序更“容易”。
    cocos2d::ParticleSystemQuad *m_emitter;
    m_emitter=ParticleSystemQuad::create("file.plist");
    m_emitter->setVisible(true);
    this->addChild(m_emitter,50);
    m_emitter->setPosition(ccp(512,384));  
m_emitter->runAction(Sequence::create(DelayTime::create(3.0),RemoveSelf::create(), NULL));