当前位置:网站首页>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)
边栏推荐
- 3dsmax snaps to frozen objects
- XSS injection
- China polyurethane rigid foam Market Research and investment forecast report (2022 Edition)
- Unity synergy
- AutoCAD -- dimension break
- 用 Jmeter 工具做个小型压力测试
- 中国AS树脂市场调研与投资预测报告(2022版)
- 3dsmax common commands
- PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
- How to choose a panoramic camera that suits you?
猜你喜欢
Unity parallax infinite scrolling background
[goweb development] Introduction to authentication modes based on cookies, sessions and JWT tokens
Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation
Leetcode word search (backtracking method)
Solutions and answers for the 2021 Shenzhen cup
LeetCode之单词搜索(回溯法求解)
AutoCAD - workspace settings
AutoCAD - lengthening
Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?
[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)
随机推荐
2022 thinking of mathematical modeling D problem of American college students / analysis of 2022 American competition D problem
MD5 bypass
Error statuslogger log4j2 could not find a logging implementation
Fluent objects and lists
Research and forecast report on China's solution polymerized styrene butadiene rubber (SSBR) industry (2022 Edition)
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
Number theoretic function and its summation to be updated
[groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)
Unity intelligent NPC production -- pre judgment walking (method 1)
django连接数据库报错,这是什么原因
#775 Div.1 C. Tyler and Strings 组合数学
Is $20billion a little less? Cisco is interested in Splunk?
[Business Research Report] top ten trends of science and technology and it in 2022 - with download link
中国金刚烷行业研究与投资预测报告(2022版)
Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?
[groovy] closure (closure as function parameter | code example)
xss注入
PR first time
2020-10-27
Flutter tips: various fancy nesting of listview and pageview