当前位置:网站首页>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)
边栏推荐
- Establish cloth effect in 10 seconds
- 2021 huashubei mathematical modeling idea + reference + paper
- 中国针状焦行业发展研究与投资价值报告(2022版)
- 2021 electrician Cup - high speed rail traction power supply system operation data analysis and equivalent modeling ideas + code
- [groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
- Difference between singleton and factory pattern
- Special information | real estate and office buildings - 22.1.9
- Rip notes [rip message security authentication, increase of rip interface measurement]
- Unity enables mobile phone vibration
- 2022/7/1学习总结
猜你喜欢

Minor spanning tree

Special information | finance, accounting, audit - 22.1.23

AutoCAD - graphic input and output
![[groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)](/img/03/329adb314606f29c8a4cb2260e84c8.jpg)
[groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)

Download the details and sequence of the original data access from the ENA database in EBI

AutoCAD - stretching
![[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)

【acwing】528. cheese

C4D simple cloth (version above R21)

669. Prune binary search tree ●●
随机推荐
2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis
AutoCAD - window zoom
"Measuring curve length" of CAD dream drawing
django连接数据库报错,这是什么原因
Introduction to JVM principle and process
Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?
How to choose a panoramic camera that suits you?
669. 修剪二叉搜索树 ●●
AutoCAD - Zoom previous
Common technologies of unity
2022 thinking of mathematical modeling D problem of American college students / analysis of 2022 American competition D problem
質量體系建設之路的分分合合
中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
Wan broadband access technology V EPON Technology
中国聚氨酯硬泡市场调研与投资预测报告(2022版)
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
【acwing】837. Number of connected block points
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
Unity sends messages and blocks indecent words
Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation