mirror of https://github.com/axmolengine/axmol.git
[ci skip]fix issue that can not change position style, can not add new emitter (#18272)
This commit is contained in:
parent
19962a3b59
commit
c4042c220b
|
@ -12,6 +12,8 @@ local baseLayer_entry = nil
|
||||||
|
|
||||||
local s = cc.Director:getInstance():getWinSize()
|
local s = cc.Director:getInstance():getWinSize()
|
||||||
|
|
||||||
|
local onEnterCallback = nil
|
||||||
|
|
||||||
local function backAction()
|
local function backAction()
|
||||||
SceneIdx = SceneIdx - 1
|
SceneIdx = SceneIdx - 1
|
||||||
if SceneIdx < 0 then
|
if SceneIdx < 0 then
|
||||||
|
@ -89,11 +91,14 @@ local function baseLayer_onEnterOrExit(tag)
|
||||||
local scheduler = cc.Director:getInstance():getScheduler()
|
local scheduler = cc.Director:getInstance():getScheduler()
|
||||||
if tag == "enter" then
|
if tag == "enter" then
|
||||||
baseLayer_entry = scheduler:scheduleScriptFunc(update, 0, false)
|
baseLayer_entry = scheduler:scheduleScriptFunc(update, 0, false)
|
||||||
|
if onEnterCallback ~= nil then
|
||||||
|
onEnterCallback()
|
||||||
|
end
|
||||||
elseif tag == "exit" then
|
elseif tag == "exit" then
|
||||||
scheduler:unscheduleScriptEntry(baseLayer_entry)
|
scheduler:unscheduleScriptEntry(baseLayer_entry)
|
||||||
if emitter ~= nil then
|
if emitter ~= nil then
|
||||||
emitter:release()
|
emitter:release()
|
||||||
emitter = nil
|
--emitter = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -228,13 +233,16 @@ local function ParticleReorder_onEnterOrExit(tag)
|
||||||
if tag == "enter" then
|
if tag == "enter" then
|
||||||
ParticleReorder_entry = scheduler:scheduleScriptFunc(reorderParticles, 1.0, false)
|
ParticleReorder_entry = scheduler:scheduleScriptFunc(reorderParticles, 1.0, false)
|
||||||
elseif tag == "exit" then
|
elseif tag == "exit" then
|
||||||
|
if ParticleReorder_entry ~= nil then
|
||||||
scheduler:unscheduleScriptEntry(ParticleReorder_entry)
|
scheduler:unscheduleScriptEntry(ParticleReorder_entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function ParticleReorder()
|
local function ParticleReorder()
|
||||||
ParticleReorder_layer = getBaseLayer()
|
ParticleReorder_layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
ParticleReorder_Order = 0
|
ParticleReorder_Order = 0
|
||||||
ParticleReorder_layer:setColor(cc.c3b(0, 0, 0))
|
ParticleReorder_layer:setColor(cc.c3b(0, 0, 0))
|
||||||
ParticleReorder_layer:removeChild(background, true)
|
ParticleReorder_layer:removeChild(background, true)
|
||||||
|
@ -285,6 +293,8 @@ local function ParticleReorder()
|
||||||
|
|
||||||
titleLabel:setString("Reordering particles")
|
titleLabel:setString("Reordering particles")
|
||||||
subtitleLabel:setString("Reordering particles with and without batches batches")
|
subtitleLabel:setString("Reordering particles with and without batches batches")
|
||||||
|
end
|
||||||
|
|
||||||
return ParticleReorder_layer
|
return ParticleReorder_layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -320,7 +330,9 @@ local function ParticleBatchHybrid_onEnterOrExit(tag)
|
||||||
if tag == "enter" then
|
if tag == "enter" then
|
||||||
ParticleBatchHybrid_entry = scheduler:scheduleScriptFunc(switchRender, 2.0, false)
|
ParticleBatchHybrid_entry = scheduler:scheduleScriptFunc(switchRender, 2.0, false)
|
||||||
elseif tag == "exit" then
|
elseif tag == "exit" then
|
||||||
|
if ParticleBatchHybrid_entry ~= nil then
|
||||||
scheduler:unscheduleScriptEntry(ParticleBatchHybrid_entry)
|
scheduler:unscheduleScriptEntry(ParticleBatchHybrid_entry)
|
||||||
|
end
|
||||||
if nil ~= emitter then
|
if nil ~= emitter then
|
||||||
emitter:release()
|
emitter:release()
|
||||||
emitter = nil
|
emitter = nil
|
||||||
|
@ -331,6 +343,7 @@ end
|
||||||
local function ParticleBatchHybrid()
|
local function ParticleBatchHybrid()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -350,6 +363,8 @@ local function ParticleBatchHybrid()
|
||||||
|
|
||||||
titleLabel:setString("Particle Batch")
|
titleLabel:setString("Particle Batch")
|
||||||
subtitleLabel:setString("Hybrid: batched and non batched every 2 seconds")
|
subtitleLabel:setString("Hybrid: batched and non batched every 2 seconds")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -359,6 +374,7 @@ end
|
||||||
local function ParticleBatchMultipleEmitters()
|
local function ParticleBatchMultipleEmitters()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -384,6 +400,8 @@ local function ParticleBatchMultipleEmitters()
|
||||||
|
|
||||||
titleLabel:setString("Particle Batch")
|
titleLabel:setString("Particle Batch")
|
||||||
subtitleLabel:setString("Multiple emitters. One Batch")
|
subtitleLabel:setString("Multiple emitters. One Batch")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -393,14 +411,16 @@ end
|
||||||
local function DemoFlower()
|
local function DemoFlower()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function()
|
||||||
emitter = cc.ParticleFlower:create()
|
emitter = cc.ParticleFlower:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
emitter:setTexture(cc.Director:getInstance():getTextureCache():addImage(s_stars1))
|
emitter:setTexture(cc.Director:getInstance():getTextureCache():addImage(s_stars1))
|
||||||
|
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleFlower")
|
titleLabel:setString("ParticleFlower")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -410,6 +430,7 @@ end
|
||||||
local function DemoGalaxy()
|
local function DemoGalaxy()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleGalaxy:create()
|
emitter = cc.ParticleGalaxy:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -419,6 +440,8 @@ local function DemoGalaxy()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleGalaxy")
|
titleLabel:setString("ParticleGalaxy")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -428,6 +451,7 @@ end
|
||||||
local function DemoFirework()
|
local function DemoFirework()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleFireworks:create()
|
emitter = cc.ParticleFireworks:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -437,6 +461,8 @@ local function DemoFirework()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleFireworks")
|
titleLabel:setString("ParticleFireworks")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -446,6 +472,7 @@ end
|
||||||
local function DemoSpiral()
|
local function DemoSpiral()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSpiral:create()
|
emitter = cc.ParticleSpiral:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -455,6 +482,8 @@ local function DemoSpiral()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleSpiral")
|
titleLabel:setString("ParticleSpiral")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -464,6 +493,7 @@ end
|
||||||
local function DemoSun()
|
local function DemoSun()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSun:create()
|
emitter = cc.ParticleSun:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -473,6 +503,8 @@ local function DemoSun()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleSun")
|
titleLabel:setString("ParticleSun")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -481,6 +513,8 @@ end
|
||||||
---------------------------------
|
---------------------------------
|
||||||
local function DemoPause()
|
local function DemoPause()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSmoke:create()
|
emitter = cc.ParticleSmoke:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -490,6 +524,8 @@ local layer = getBaseLayer()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("Pasue Particle")
|
titleLabel:setString("Pasue Particle")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -499,6 +535,7 @@ end
|
||||||
local function DemoMeteor()
|
local function DemoMeteor()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleMeteor:create()
|
emitter = cc.ParticleMeteor:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -508,6 +545,8 @@ local function DemoMeteor()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleMeteor")
|
titleLabel:setString("ParticleMeteor")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -517,6 +556,7 @@ end
|
||||||
local function DemoFire()
|
local function DemoFire()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleFire:create()
|
emitter = cc.ParticleFire:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -526,6 +566,8 @@ local function DemoFire()
|
||||||
emitter:setPosition(pos_x, 100)
|
emitter:setPosition(pos_x, 100)
|
||||||
|
|
||||||
titleLabel:setString("ParticleFire")
|
titleLabel:setString("ParticleFire")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -535,6 +577,7 @@ end
|
||||||
local function DemoSmoke()
|
local function DemoSmoke()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSmoke:create()
|
emitter = cc.ParticleSmoke:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -545,6 +588,8 @@ local function DemoSmoke()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleSmoke")
|
titleLabel:setString("ParticleSmoke")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -554,6 +599,7 @@ end
|
||||||
local function DemoExplosion()
|
local function DemoExplosion()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleExplosion:create()
|
emitter = cc.ParticleExplosion:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -565,6 +611,8 @@ local function DemoExplosion()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleExplosion")
|
titleLabel:setString("ParticleExplosion")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -574,6 +622,7 @@ end
|
||||||
local function DemoSnow()
|
local function DemoSnow()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSnow:create()
|
emitter = cc.ParticleSnow:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -606,6 +655,8 @@ local function DemoSnow()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleSnow")
|
titleLabel:setString("ParticleSnow")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -615,6 +666,7 @@ end
|
||||||
local function DemoRain()
|
local function DemoRain()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleRain:create()
|
emitter = cc.ParticleRain:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
background:addChild(emitter, 10)
|
background:addChild(emitter, 10)
|
||||||
|
@ -627,6 +679,8 @@ local function DemoRain()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleRain")
|
titleLabel:setString("ParticleRain")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -636,6 +690,7 @@ end
|
||||||
local function DemoBigFlower()
|
local function DemoBigFlower()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSystemQuad:createWithTotalParticles(50)
|
emitter = cc.ParticleSystemQuad:createWithTotalParticles(50)
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
|
|
||||||
|
@ -696,6 +751,8 @@ local function DemoBigFlower()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleBigFlower")
|
titleLabel:setString("ParticleBigFlower")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -705,6 +762,7 @@ end
|
||||||
local function DemoRotFlower()
|
local function DemoRotFlower()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSystemQuad:createWithTotalParticles(300)
|
emitter = cc.ParticleSystemQuad:createWithTotalParticles(300)
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
|
|
||||||
|
@ -768,6 +826,8 @@ local function DemoRotFlower()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("ParticleRotFlower")
|
titleLabel:setString("ParticleRotFlower")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -777,6 +837,7 @@ end
|
||||||
local function DemoModernArt()
|
local function DemoModernArt()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleSystemQuad:createWithTotalParticles(1000)
|
emitter = cc.ParticleSystemQuad:createWithTotalParticles(1000)
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
|
|
||||||
|
@ -837,6 +898,8 @@ local function DemoModernArt()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("Varying size")
|
titleLabel:setString("Varying size")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -846,6 +909,7 @@ end
|
||||||
local function DemoRing()
|
local function DemoRing()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
emitter = cc.ParticleFlower:create()
|
emitter = cc.ParticleFlower:create()
|
||||||
emitter:retain()
|
emitter:retain()
|
||||||
|
|
||||||
|
@ -861,6 +925,8 @@ local function DemoRing()
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString("Ring Demo")
|
titleLabel:setString("Ring Demo")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -870,6 +936,7 @@ end
|
||||||
local function ParallaxParticle()
|
local function ParallaxParticle()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
background:getParent():removeChild(background, true)
|
background:getParent():removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
|
||||||
|
@ -899,6 +966,8 @@ local function ParallaxParticle()
|
||||||
p:runAction(cc.RepeatForever:create(seq))
|
p:runAction(cc.RepeatForever:create(seq))
|
||||||
|
|
||||||
titleLabel:setString("Parallax + Particles")
|
titleLabel:setString("Parallax + Particles")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -908,6 +977,7 @@ end
|
||||||
local function DemoParticleFromFile(name)
|
local function DemoParticleFromFile(name)
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -921,6 +991,8 @@ local function DemoParticleFromFile(name)
|
||||||
setEmitterPosition()
|
setEmitterPosition()
|
||||||
|
|
||||||
titleLabel:setString(name)
|
titleLabel:setString(name)
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -930,6 +1002,7 @@ end
|
||||||
local function RadiusMode1()
|
local function RadiusMode1()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -993,6 +1066,8 @@ local function RadiusMode1()
|
||||||
emitter:setBlendAdditive(false)
|
emitter:setBlendAdditive(false)
|
||||||
|
|
||||||
titleLabel:setString("Radius Mode: Spiral")
|
titleLabel:setString("Radius Mode: Spiral")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1002,6 +1077,7 @@ end
|
||||||
local function RadiusMode2()
|
local function RadiusMode2()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1064,6 +1140,8 @@ local function RadiusMode2()
|
||||||
emitter:setBlendAdditive(false)
|
emitter:setBlendAdditive(false)
|
||||||
|
|
||||||
titleLabel:setString("Radius Mode: Semi Circle")
|
titleLabel:setString("Radius Mode: Semi Circle")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1073,6 +1151,7 @@ end
|
||||||
local function Issue704()
|
local function Issue704()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1140,6 +1219,8 @@ local function Issue704()
|
||||||
|
|
||||||
titleLabel:setString("Issue 704. Free + Rot")
|
titleLabel:setString("Issue 704. Free + Rot")
|
||||||
subtitleLabel:setString("Emitted particles should not rotate")
|
subtitleLabel:setString("Emitted particles should not rotate")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1162,17 +1243,19 @@ local function Issue870_onEnterOrExit(tag)
|
||||||
if tag == "enter" then
|
if tag == "enter" then
|
||||||
Issue870_entry = scheduler:scheduleScriptFunc(updateQuads, 2.0, false)
|
Issue870_entry = scheduler:scheduleScriptFunc(updateQuads, 2.0, false)
|
||||||
elseif tag == "exit" then
|
elseif tag == "exit" then
|
||||||
|
if Issue870_entry ~= nil then
|
||||||
scheduler:unscheduleScriptEntry(Issue870_entry)
|
scheduler:unscheduleScriptEntry(Issue870_entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function Issue870()
|
local function Issue870()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
|
||||||
local system = cc.ParticleSystemQuad:create("Particles/SpinningPeas.plist")
|
local system = cc.ParticleSystemQuad:create("Particles/SpinningPeas.plist")
|
||||||
system:setTextureWithRect(cc.Director:getInstance():getTextureCache():addImage("Images/particles.png"), cc.rect(0,0,32,32))
|
system:setTextureWithRect(cc.Director:getInstance():getTextureCache():addImage("Images/particles.png"), cc.rect(0,0,32,32))
|
||||||
layer:addChild(system, 10)
|
layer:addChild(system, 10)
|
||||||
|
@ -1184,6 +1267,8 @@ local function Issue870()
|
||||||
|
|
||||||
titleLabel:setString("Issue 870. SubRect")
|
titleLabel:setString("Issue 870. SubRect")
|
||||||
subtitleLabel:setString("Every 2 seconds the particle should change")
|
subtitleLabel:setString("Every 2 seconds the particle should change")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1193,6 +1278,7 @@ end
|
||||||
local function MultipleParticleSystems()
|
local function MultipleParticleSystems()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1210,6 +1296,8 @@ local function MultipleParticleSystems()
|
||||||
|
|
||||||
titleLabel:setString("Multiple particle systems")
|
titleLabel:setString("Multiple particle systems")
|
||||||
subtitleLabel:setString("v1.1 test: FPS should be lower than next test")
|
subtitleLabel:setString("v1.1 test: FPS should be lower than next test")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1219,6 +1307,7 @@ end
|
||||||
local function MultipleParticleSystemsBatched()
|
local function MultipleParticleSystemsBatched()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1238,6 +1327,8 @@ local function MultipleParticleSystemsBatched()
|
||||||
|
|
||||||
titleLabel:setString("Multiple particle systems batched")
|
titleLabel:setString("Multiple particle systems batched")
|
||||||
subtitleLabel:setString("v1.1 test: should perform better than previous test")
|
subtitleLabel:setString("v1.1 test: should perform better than previous test")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1274,13 +1365,16 @@ local function AddAndDeleteParticleSystems_onEnterOrExit(tag)
|
||||||
if tag == "enter" then
|
if tag == "enter" then
|
||||||
AddAndDeleteParticleSystems_entry = scheduler:scheduleScriptFunc(removeSystem, 2.0, false)
|
AddAndDeleteParticleSystems_entry = scheduler:scheduleScriptFunc(removeSystem, 2.0, false)
|
||||||
elseif tag == "exit" then
|
elseif tag == "exit" then
|
||||||
|
if AddAndDeleteParticleSystems_entry ~= nil then
|
||||||
scheduler:unscheduleScriptEntry(AddAndDeleteParticleSystems_entry)
|
scheduler:unscheduleScriptEntry(AddAndDeleteParticleSystems_entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function AddAndDeleteParticleSystems()
|
local function AddAndDeleteParticleSystems()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1308,6 +1402,8 @@ local function AddAndDeleteParticleSystems()
|
||||||
|
|
||||||
titleLabel:setString("Add and remove Particle System")
|
titleLabel:setString("Add and remove Particle System")
|
||||||
subtitleLabel:setString("v1.1 test: every 2 sec 1 system disappear, 1 appears")
|
subtitleLabel:setString("v1.1 test: every 2 sec 1 system disappear, 1 appears")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1334,13 +1430,16 @@ local function ReorderParticleSystems_onEnterOrExit(tag)
|
||||||
if tag == "enter" then
|
if tag == "enter" then
|
||||||
ReorderParticleSystems_entry = scheduler:scheduleScriptFunc(reorderSystem, 2.0, false)
|
ReorderParticleSystems_entry = scheduler:scheduleScriptFunc(reorderSystem, 2.0, false)
|
||||||
elseif tag == "exit" then
|
elseif tag == "exit" then
|
||||||
|
if ReorderParticleSystems_entry ~= nil then
|
||||||
scheduler:unscheduleScriptEntry(ReorderParticleSystems_entry)
|
scheduler:unscheduleScriptEntry(ReorderParticleSystems_entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function ReorderParticleSystems()
|
local function ReorderParticleSystems()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background ,true)
|
layer:removeChild(background ,true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1424,6 +1523,8 @@ local function ReorderParticleSystems()
|
||||||
|
|
||||||
titleLabel:setString("reorder systems")
|
titleLabel:setString("reorder systems")
|
||||||
subtitleLabel:setString("changes every 2 seconds")
|
subtitleLabel:setString("changes every 2 seconds")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1433,6 +1534,7 @@ end
|
||||||
local function PremultipliedAlphaTest()
|
local function PremultipliedAlphaTest()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 255))
|
layer:setColor(cc.c3b(0, 0, 255))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1453,6 +1555,8 @@ local function PremultipliedAlphaTest()
|
||||||
|
|
||||||
titleLabel:setString("premultiplied alpha")
|
titleLabel:setString("premultiplied alpha")
|
||||||
subtitleLabel:setString("no black halo, particles should fade out")
|
subtitleLabel:setString("no black halo, particles should fade out")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1462,6 +1566,7 @@ end
|
||||||
local function PremultipliedAlphaTest2()
|
local function PremultipliedAlphaTest2()
|
||||||
local layer = getBaseLayer()
|
local layer = getBaseLayer()
|
||||||
|
|
||||||
|
onEnterCallback = function ()
|
||||||
layer:setColor(cc.c3b(0, 0, 0))
|
layer:setColor(cc.c3b(0, 0, 0))
|
||||||
layer:removeChild(background, true)
|
layer:removeChild(background, true)
|
||||||
background = nil
|
background = nil
|
||||||
|
@ -1472,6 +1577,8 @@ local function PremultipliedAlphaTest2()
|
||||||
|
|
||||||
titleLabel:setString("premultiplied alpha 2")
|
titleLabel:setString("premultiplied alpha 2")
|
||||||
subtitleLabel:setString("Arrows should be faded")
|
subtitleLabel:setString("Arrows should be faded")
|
||||||
|
end
|
||||||
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue