写了好久的lua,cpp都快忘完了,悲剧,今天记录一下粒子效果
ParticleFire*pf = ParticleFire::create(); pf->retain(); this->addChild(pf,100); pf->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseNormal.png")); pf->setPosition(Point(visibleSize.width / 2,visibleSize.height / 2));其实自己可以编辑粒子效果,用到的粒子编辑器如下:
IOS:Particle Designer
现在有Windows的了,不过粒子效果不如ios的全,还是建议使用ios的
自己编辑好的粒子效果使用如下:
ParticleSystemQuad*pq = ParticleSystemQuad::create("myTest.plist"); pq->retain(); this->addChild(pq,100); pq->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseNormal.png")); pq->setPosition(Point(visibleSize.width / 2,visibleSize.height / 2));
lua的也差不多:
local lz=cc.ParticleSystemQuad:create("res/myTest.plist") ly:addChild(lz,100) lz:retain() lz:setTexture(cc.Director:getInstance():getTextureCache():addImage("res/eyeClose.png")) lz:setPosition(100,100)原文链接:https://www.f2er.com/cocos2dx/344450.html