博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
粒子效果 CCParticleSystem 编码的实现
阅读量:7207 次
发布时间:2019-06-29

本文共 1602 字,大约阅读时间需要 5 分钟。

CCParticleSystem *sun; //// fire //        CCParticleSystem* ff = [CCParticleFire node]; //        ff.position = ccp(80,90);        //        ff.totalParticles = 50; //        ff.life = 2.0f; //        ff.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; //        [self addChild:ff]; //        //// ga 旋转蓝色的银河 //        CCParticleSystem* ga = [CCParticleGalaxy node]; //        ga.position = ccp(240,240);        //        ga.totalParticles = 100; //        ga.life = 1.5f; //        [self addChild:ga]; ////-----------//sun         sun = [CCParticleSun node];         sun.position = ccp(12,12); //--------变小了         sun.emitterMode = kCCParticleModeGravity;         sun.startSize = 10.0f;         sun.startSizeVar = 10.0f;         sun.endSize = 30.0f;         sun.endSizeVar = 30.0f;         sun.totalParticles = 30;         sun.life = 1.0f;         sun.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];         [self addChild:sun]; ////-----------//smoke         smoke = [CCParticleSmoke node];         smoke.position = ccp(12,12); //--------变小了         smoke.emitterMode = kCCParticleModeGravity;         smoke.startSize = 10.0f;         smoke.startSizeVar = 10.0f;         smoke.endSize = 30.0f;         smoke.endSizeVar = 30.0f;         smoke.totalParticles = 30;         smoke.life = 1.0f;         [self addChild:smoke];

以上是硬编码

 

下面使用plist 文件

emitter = [[CCParticleSystemQuad alloc] initWithFile:@"particleFeder.plist"];     emitter.position = self.position;     [_scene addChild:emitter z:10];

转载于:https://www.cnblogs.com/pengyingh/articles/2435082.html

你可能感兴趣的文章
nodejs发展
查看>>
Fragment过度动画分析一
查看>>
UBI文件系统简介
查看>>
《现代操作系统》精读与思考笔记 第一章 引论
查看>>
System.out.print实现原理猜解
查看>>
每日英语:The Invasion of the Online Tutors
查看>>
codepage IMLangCodePages
查看>>
Leetcode: Valid Parentheses
查看>>
JavaScript Structure
查看>>
java 流媒体服务器Red5 FQA
查看>>
mysql--SQL编程(关于mysql中的日期) 学习笔记2
查看>>
jquery 请求jsp传递json数据的方法
查看>>
Repeater绑定事件ItemDataBound中获取数据库中数据
查看>>
草长莺飞,总归一字
查看>>
HDOJ 2097
查看>>
计算机学科漫谈
查看>>
mac下配置openfire
查看>>
自定义控件实现(转)
查看>>
如何确认访客所在的国家
查看>>
跟着8张思维导图学习javascript
查看>>