14.2Cocos2d-x 中的粒子系统(笔记);14.2.1 ParticleBatch
发布时间:2020-12-14 21:39:45 所属栏目:百科 来源:网络整理
导读:1,批处理类ParticleBatchNode 2,粒子系统类ParticleSystem 3,粒子系统子类 ParticleSystemQuad 爆炸效果:ParticleExplosion; 火球效果: ParticleFire 14.2.1 粒子批处理类ParticleBatchNode initWithFile initWithTexture disableParticle; setBlendFunc/
1,批处理类ParticleBatchNode 2,粒子系统类ParticleSystem 3,粒子系统子类 ParticleSystemQuad
爆炸效果:ParticleExplosion; 火球效果: ParticleFire
14.2.1 粒子批处理类ParticleBatchNode initWithFile
initWithTexture disableParticle; setBlendFunc/getBlendFunc; updateAllAtlasIndexes; increaseAtlasCapacityTo; getCurrentIndex; searchNewPositionInChildernForZ; 代码实例: bool HelloWorld::init() { ////////////////////////////// // 1. super init first if ( !Layer::init() ) { return false; } Size visibleSize = Director::getInstance()->getVisibleSize(); Vec2 origin = Director::getInstance()->getVisibleOrigin(); // 创建精灵类 auto sprite = Sprite::create("taotaoahui.jpg"); //sprite->setPosition(ccp(visibleSize.width / 2,visibleSize.height / 2)); sprite->setAnchorPoint(ccp(0,0)); addChild(sprite,1); // ParticleBatchNode 使用方法, auto _emitter = ParticleSystemQuad::create("Particles/taotao.xml.particle.plist");// 首先创建ParticleSystemQuad或者ParticleSystem _emitter->retain(); auto batch = ParticleBatchNode::createWithTexture(_emitter->getTexture()); batch->addChild(_emitter); batch->setPosition(ccp(visibleSize.width /2,visibleSize.height /2 )); // sjt this->addChild(batch,10); return true; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- JSON.parse()和JSON.stringify()
- 使用JSON.NET进行序列化时隐藏C#属性
- c# – 解释ds.Tables [0] .Rows.Count?
- Oracle案例之-ORA-00600: internal error code, arguments:
- c# – LINQ with GROUP BY和HAVING COUNT
- 【cocos2d-js官方文档】十九、Cocos2d-JS单文件引擎使用指引
- c# – 在托管代码中,如何获得良好的参考位置?
- Ajax 请求的http头信息特点 x-requested-with
- c# – HttpPostedFileBase到byte []如何保持编码?
- flex RSL