【Cocosd2d实例教程七】Cocos2d实现超炫的粒子效果!!
(转载请注明出处:http://blog.csdn.net/buptgshengod)
1.介绍 你想拥有炫酷的效果么,你想让你的应用亮瞎别人的狗眼么!!不要急,这里告诉大家怎么实现绚丽的粒子效果!先上个图,点击界面产生火焰!(依旧是动态的,只是作者懒得截动态图)-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ return YES; }-(void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event{ }-(void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event{ CGPoint touchLocation = [touch locationInView:[touch view]]; touchLocation = [[CCDirector sharedDirector]convertToGL:touchLocation]; touchLocation =[self convertToNodeSpace:touchLocation];//这三句是确定点击屏幕的位置 CCParticleRain *rain=[CCParticleRain node];//选择的是CCParticle中的Rain模式,其实有很多种 [self addChild:rain z:1];//有人会问z是什么意思,z的数值是指层次,z大的成员在小的上面 rain.position=touchLocation; CCParticleSystemQuad *fire=[CCParticleSystemQuad particleWithFile:@"fire.plist"]; [self addChild:fire z:1];//加入资源 fire.position = touchLocation; }
依旧是贡献出源代码以及工具
ParticleDesigner下载地址
文章源码