14.2Cocos2d-x 中的粒子系统(笔记);14.2.1 ParticleBatchNode;
来源:互联网 发布:泰拉瑞亚数据如何恢复 编辑:程序博客网 时间:2024/04/28 19:10
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;}
0 0
- 14.2Cocos2d-x 中的粒子系统(笔记);14.2.1 ParticleBatchNode;
- cocos2d-x初探学习笔记(9)--粒子系统
- cocos2d-x初探学习笔记(9)--粒子系统
- cocos2d-x学习笔记(12)--粒子系统
- 学习cocos2d-x笔记E1:粒子系统
- 【学习笔记】cocos2d-x 粒子系统
- cocos2d-x粒子系统
- cocos2d-x粒子系统
- cocos2d-x 粒子系统
- Cocos2d-x 粒子系统
- cocos2d-x 粒子系统
- Cocos2d-x粒子系统
- Cocos2d-x粒子系统
- cocos2d-x粒子系统
- Cocos2d-x 粒子系统
- Cocos2d-X中的粒子
- 我的Cocos2d-x学习笔记(二十一)内置粒子系统、使用粒子特效文件
- cocos2d-x学习之粒子系统1
- opencv图像求差的绝对值cvAbsDiff和形态学开运算cvMorphologyEx
- JNI使用指南(存起来自己看)
- Leetcode|Flatten Binary Tree to Linked List
- 用户密码的存储与密码传输
- 《猜猜看游戏》第四天
- 14.2Cocos2d-x 中的粒子系统(笔记);14.2.1 ParticleBatchNode;
- GRE写作必备句型
- Spring之AOP实现面向切面编程
- mysql备份与还原
- jsp中页面之间的跳转forward与sendRedirect的区别
- ppt文档快速的转换为pdf方法分享
- 【Linux】IO多路转接
- 工作中用到的模型诊断指数
- C++之指针指向二维数组