当前位置:网站首页>cocos2dx_ Lua particle system
cocos2dx_ Lua particle system
2022-07-05 04:56:00 【Meteor spot】
-- A shooting star
local meteor = cc.ParticleMeteor:createWithTotalParticles(130)
-- meteor:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
meteor:setPosition(cc.p( 250, 200))
meteor:setLocalZOrder(9999)
meteor:setLife(5.0)
self:addChild(meteor)
-- rain
local rain = cc.ParticleRain:createWithTotalParticles(130)
-- rain:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
rain:setPosition(cc.p( 300, 200))
rain:setLocalZOrder(9999)
rain:setLife(5.0)
self:addChild(rain)
-- snow
local snow = cc.ParticleSnow:createWithTotalParticles(130)
-- snow:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
snow:setPosition(cc.p( 350, 200))
snow:setLocalZOrder(9999)
snow:setLife(5.0)
self:addChild(snow)
-- The explosion
local explosion = cc.ParticleExplosion:createWithTotalParticles(130)
-- explosion:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
explosion:setPosition(cc.p( 350, 200))
explosion:setLocalZOrder(9999)
explosion:setLife(5.0)
self:addChild(explosion)
-- smoke
local smoke = cc.ParticleSmoke:createWithTotalParticles(130)
-- smoke:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
smoke:setPosition(cc.p( 350, 200))
smoke:setLocalZOrder(9999)
smoke:setLife(5.0)
self:addChild(smoke)
-- Whirlpool
local spiral = cc.ParticleSpiral:createWithTotalParticles(130)
-- spiral:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
spiral:setPosition(cc.p( 450, 200))
spiral:setLocalZOrder(9999)
spiral:setLife(5.0)
self:addChild(spiral)
local sun = cc.ParticleSun:createWithTotalParticles(130)
-- sun:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
sun:setPosition(cc.p( 500, 200))
sun:setLocalZOrder(9999)
sun:setLife(1.0)
self:addChild(sun)
local fire = cc.ParticleFire:createWithTotalParticles(130)
--fire:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
fire:setPosition(cc.p( 550, 200))
fire:setLocalZOrder(9999)
fire:setLife(1.0)
self:addChild(fire)
local fireworks = cc.ParticleFireworks:createWithTotalParticles(50)
--fireworks:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
fireworks:setPosition(cc.p( 550, 200))
fireworks:setLocalZOrder(9999)
fireworks:setLife(1.0)
self:addChild(fireworks)
local galaxy = cc.ParticleGalaxy:createWithTotalParticles(130)
--galaxy:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
galaxy:setPosition(cc.p( 550, 200))
galaxy:setLocalZOrder(9999)
galaxy:setLife(1.0)
self:addChild(galaxy)
local flower = cc.ParticleFlower:createWithTotalParticles(130)
-- flower:setTexture(cc.Director:getInstance():getTextureCache():addImage("wsk1.png"))
flower:setPosition(cc.p( 600, 200))
flower:setLocalZOrder(9999)
flower:setLife(1.0)
self:addChild(flower)
Load custom particle effects
local particleSystem = cc.ParticleSystemQuad:create("lobby/Desktop.plist");
particleSystem:setPosition(cc.p(500,300));
layer:addChild(particleSystem)
边栏推荐
- 质量体系建设之路的分分合合
- Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
- How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing
- PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
- Unity3d learning notes
- Interface joint commissioning test script optimization V5.0 (end)
- C4D simple cloth (version above R21)
- MySQL audit log archiving
- China polyurethane rigid foam Market Research and investment forecast report (2022 Edition)
- AutoCAD - Document Management
猜你喜欢
![[groovy] closure (closure as function parameter | code example)](/img/a6/a4ed401acfb61f85eb08daa15a8a80.jpg)
[groovy] closure (closure as function parameter | code example)

UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存

3dsmax snaps to frozen objects

数论函数及其求和 待更新

stm32Cubemx(8):RTC和RTC唤醒中断

Understand encodefloatrgba and decodefloatrgba

Introduction to JVM principle and process

2022 thinking of mathematical modeling D problem of American college students / analysis of 2022 American competition D problem

質量體系建設之路的分分合合

LeetCode之单词搜索(回溯法求解)
随机推荐
AutoCAD -- dimension break
UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化
54. Spiral matrix & 59 Spiral matrix II ●●
Rip notes [rip message security authentication, increase of rip interface measurement]
[groovy] closure closure (customize closure parameters | customize a single closure parameter | customize multiple closure parameters | specify the default value of closure parameters)
GameObject class and transform class of unity
Number theoretic function and its summation to be updated
猿人学第一题
UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存
2022 thinking of mathematical modeling a problem of American college students / analysis of 2022 American competition a problem
54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
669. 修剪二叉搜索树 ●●
Unity shot tracking object
Use assimp library to read MTL file data
Flink集群配置
Basic knowledge points
[Chongqing Guangdong education] National Open University 2047t commercial bank operation and management reference test in autumn 2018
Wan broadband access technology V EPON Technology
Detailed explanation of the ranking of the best universities
How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing