当前位置:网站首页>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)
边栏推荐
- Introduce Hamming distance and calculation examples
- Unity and database
- MD5 bypass
- Unity connects to the database
- Sqlserver stored procedures pass array parameters
- Emlog blog theme template source code simple good-looking responsive
- PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
- [Chongqing Guangdong education] National Open University 2047t commercial bank operation and management reference test in autumn 2018
- On-off and on-off of quality system construction
- C # perspective following
猜你喜欢
质量体系建设之路的分分合合
2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
Pdf to DWG in CAD
UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化
2021-10-29
Manually implement heap sorting -838 Heap sort
【acwing】528. cheese
Leetcode word search (backtracking method)
On-off and on-off of quality system construction
Unity get component
随机推荐
China polyurethane rigid foam Market Research and investment forecast report (2022 Edition)
Solutions and answers for the 2021 Shenzhen cup
Judge the position of the monster in the role under unity3d
Number theoretic function and its summation to be updated
[Business Research Report] Research Report on male consumption trends in other economic times -- with download link
Dotween usage records ----- appendinterval, appendcallback
数论函数及其求和 待更新
"Measuring curve length" of CAD dream drawing
AutoCAD - window zoom
Flink集群配置
Database under unity
猿人学第一题
Create a pyGame window with a blue background
3dsmax snaps to frozen objects
Panel panel of UI
3dsmax2018 common operations and some shortcut keys of editable polygons
3dsmax common commands
【acwing】240. food chain
AutoCAD - lengthening
AutoCAD -- dimension break