当前位置:网站首页>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)
边栏推荐
- An article takes you to thoroughly understand descriptors
- [groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
- SQL set operation
- 2022/7/1学习总结
- AutoCAD - Zoom previous
- Detailed introduction of OSPF header message
- 2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
- 2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
- [groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)
- #775 Div.1 C. Tyler and Strings 组合数学
猜你喜欢

xss注入

2021 huashubei mathematical modeling idea + reference + paper

Redis has four methods for checking big keys, which are necessary for optimization

C4D simple cloth (version above R21)

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

Use assimp library to read MTL file data
![Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]](/img/e7/f699ee982ea325b8d04f8bd467a559.jpg)
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]

AutoCAD - window zoom
![[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)](/img/1b/1fa2ebc9a6c5d271c9b39f5e508fb0.jpg)
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)

AutoCAD - stretching
随机推荐
Unity check whether the two objects have obstacles by ray
Wan broadband access technology V EPON Technology
Manually implement heap sorting -838 Heap sort
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
Database under unity
Redis 排查大 key 的4种方法,优化必备
Out and ref functions of unity
用 Jmeter 工具做个小型压力测试
中国针状焦行业发展研究与投资价值报告(2022版)
Number theoretic function and its summation to be updated
SQLServer 存储过程传递数组参数
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
Sqlserver stored procedures pass array parameters
Unity and database
中国艾草行业研究与投资前景预测报告(2022版)
The first topic of ape Anthropology
On-off and on-off of quality system construction
Unity3d learning notes
Special information | finance, accounting, audit - 22.1.23
[Chongqing Guangdong education] National Open University 2047t commercial bank operation and management reference test in autumn 2018