2013-08-16 10:12:46 +08:00
|
|
|
local scheduler = cc.Director:getInstance():getScheduler()
|
2013-04-02 11:28:31 +08:00
|
|
|
local kTagLayer = 1
|
|
|
|
|
|
|
|
local function createLayerDemoLayer(title, subtitle)
|
2013-08-16 10:12:46 +08:00
|
|
|
local layer = cc.Layer:create()
|
2013-04-02 11:28:31 +08:00
|
|
|
Helper.initWithLayer(layer)
|
|
|
|
local titleStr = title == nil and "No title" or title
|
2013-04-02 17:52:08 +08:00
|
|
|
local subTitleStr = subtitle == nil and "" or subtitle
|
2013-04-02 11:28:31 +08:00
|
|
|
Helper.titleLabel:setString(titleStr)
|
|
|
|
Helper.subtitleLabel:setString(subTitleStr)
|
|
|
|
|
|
|
|
-- local prev = {x = 0, y = 0}
|
|
|
|
-- local function onTouchEvent(eventType, x, y)
|
|
|
|
-- if eventType == "began" then
|
|
|
|
-- prev.x = x
|
|
|
|
-- prev.y = y
|
|
|
|
-- return true
|
|
|
|
-- elseif eventType == "moved" then
|
|
|
|
-- local node = layer:getChildByTag(kTagTileMap)
|
|
|
|
-- local newX = node:getPositionX()
|
|
|
|
-- local newY = node:getPositionY()
|
|
|
|
-- local diffX = x - prev.x
|
|
|
|
-- local diffY = y - prev.y
|
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
-- node:setPosition( cc.p.__add(cc.p(newX, newY), cc.p(diffX, diffY)) )
|
2013-04-02 11:28:31 +08:00
|
|
|
-- prev.x = x
|
|
|
|
-- prev.y = y
|
|
|
|
-- end
|
|
|
|
-- end
|
|
|
|
-- layer:setTouchEnabled(true)
|
|
|
|
-- layer:registerScriptTouchHandler(onTouchEvent)
|
|
|
|
return layer
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
--#pragma mark - Cascading support extensions
|
|
|
|
|
|
|
|
local function setEnableRecursiveCascading(node, enable)
|
2013-04-02 17:52:08 +08:00
|
|
|
if node == nil then
|
|
|
|
-- cclog("node == nil, return directly")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2013-08-23 16:12:59 +08:00
|
|
|
if node.setCascadeColorEnabled ~= nil and node.setCascadeOpacityEnabled ~= nil then
|
|
|
|
node:setCascadeColorEnabled(enable)
|
|
|
|
node:setCascadeOpacityEnabled(enable)
|
2013-04-01 18:05:35 +08:00
|
|
|
end
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 11:28:31 +08:00
|
|
|
local obj = nil
|
2013-04-02 17:52:08 +08:00
|
|
|
local children = node:getChildren()
|
|
|
|
if children == nil then
|
|
|
|
-- cclog("children is nil")
|
2013-08-20 13:44:37 +08:00
|
|
|
print("children is nil")
|
2013-04-02 17:52:08 +08:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2013-04-02 11:28:31 +08:00
|
|
|
local i = 0
|
2013-08-16 10:12:46 +08:00
|
|
|
local len = table.getn(children)
|
2013-04-02 11:28:31 +08:00
|
|
|
for i = 0, len-1, 1 do
|
2013-08-23 16:12:59 +08:00
|
|
|
setEnableRecursiveCascading(children[i + 1], enable)
|
2013-04-01 18:05:35 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- LayerTestCascadingOpacityA
|
2013-04-02 11:28:31 +08:00
|
|
|
local function LayerTestCascadingOpacityA()
|
2013-12-06 18:07:16 +08:00
|
|
|
local ret = createLayerDemoLayer("Layer: cascading opacity")
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
2013-12-06 18:07:16 +08:00
|
|
|
local layer1 = cc.Layer:create()
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-01 18:05:35 +08:00
|
|
|
layer1:addChild(sister1)
|
|
|
|
layer1:addChild(sister2)
|
|
|
|
layer1:addChild(label)
|
2013-04-02 11:28:31 +08:00
|
|
|
ret:addChild( layer1, 0, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, s.height/2))
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, s.height/2))
|
|
|
|
label:setPosition( cc.p( s.width/2, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.FadeTo:create(4, 0),
|
|
|
|
cc.FadeTo:create(4, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-02 17:52:08 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
|
|
|
|
sister1:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.FadeTo:create(2, 0),
|
|
|
|
cc.FadeTo:create(2, 255),
|
|
|
|
cc.FadeTo:create(2, 0),
|
|
|
|
cc.FadeTo:create(2, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-01 18:05:35 +08:00
|
|
|
-- Enable cascading in scene
|
2013-04-02 17:52:08 +08:00
|
|
|
setEnableRecursiveCascading(ret, true)
|
|
|
|
return ret
|
2013-04-01 18:05:35 +08:00
|
|
|
end
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerTestCascadingOpacityB
|
|
|
|
local function LayerTestCascadingOpacityB()
|
|
|
|
local ret = createLayerDemoLayer("CCLayerColor: cascading opacity")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer1 = cc.LayerColor:create(cc.c4b(192, 0, 0, 255), s.width, s.height/2)
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:setCascadeColorEnabled(false)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:setPosition( cc.p(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:addChild(sister1)
|
|
|
|
layer1:addChild(sister2)
|
|
|
|
layer1:addChild(label)
|
|
|
|
ret:addChild( layer1, 0, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, 0))
|
|
|
|
label:setPosition( cc.p( s.width/2, 0))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.FadeTo:create(4, 0),cc.FadeTo:create(4, 255),cc.DelayTime:create(1))))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.FadeTo:create(2, 0),cc.FadeTo:create(2, 255),cc.FadeTo:create(2, 0),cc.FadeTo:create(2, 255),cc.DelayTime:create(1))))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- Enable cascading in scene
|
|
|
|
setEnableRecursiveCascading(ret, true)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerTestCascadingOpacityC
|
|
|
|
local function LayerTestCascadingOpacityC()
|
2013-08-16 10:12:46 +08:00
|
|
|
local ret = createLayerDemoLayer("LayerColor: non-cascading opacity")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer1 = cc.LayerColor:create(cc.c4b(192, 0, 0, 255), s.width, s.height/2)
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:setCascadeColorEnabled(false)
|
|
|
|
layer1:setCascadeOpacityEnabled(false)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:setPosition( cc.p(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:addChild(sister1)
|
|
|
|
layer1:addChild(sister2)
|
|
|
|
layer1:addChild(label)
|
|
|
|
ret:addChild( layer1, 0, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, 0))
|
|
|
|
label:setPosition( cc.p( s.width/2, 0))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.FadeTo:create(4, 0),
|
|
|
|
cc.FadeTo:create(4, 255),cc.DelayTime:create(1))))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.FadeTo:create(2, 0),cc.FadeTo:create(2, 255),
|
|
|
|
cc.FadeTo:create(2, 0),cc.FadeTo:create(2, 255),cc.DelayTime:create(1))))
|
2013-04-02 17:52:08 +08:00
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
--#pragma mark Example LayerTestCascadingColor
|
2013-04-02 11:28:31 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerTestCascadingColorA
|
|
|
|
local function LayerTestCascadingColorA()
|
2013-12-06 18:07:16 +08:00
|
|
|
local ret = createLayerDemoLayer("Layer: cascading color")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
2013-12-06 18:07:16 +08:00
|
|
|
local layer1 = cc.Layer:create()
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:addChild(sister1)
|
|
|
|
layer1:addChild(sister2)
|
|
|
|
layer1:addChild(label)
|
|
|
|
ret:addChild( layer1, 0, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, s.height/2))
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, s.height/2))
|
|
|
|
label:setPosition( cc.p( s.width/2, s.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.RepeatForever:create(
|
|
|
|
cc.Sequence:create(cc.TintTo:create(6, 255, 0, 255),
|
|
|
|
cc.TintTo:create(6, 255, 255, 255),
|
|
|
|
cc.DelayTime:create(1)
|
2013-04-02 17:52:08 +08:00
|
|
|
)))
|
|
|
|
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.RepeatForever:create(
|
|
|
|
cc.Sequence:create(cc.TintTo:create(2, 255, 255, 0),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.TintTo:create(2, 0, 255, 255),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.TintTo:create(2, 255, 0, 255),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- Enable cascading in scene
|
|
|
|
setEnableRecursiveCascading(ret, true)
|
2013-04-05 16:13:04 +08:00
|
|
|
return ret
|
2013-04-02 17:52:08 +08:00
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerTestCascadingColorB
|
|
|
|
local function LayerTestCascadingColorB()
|
2013-08-16 10:12:46 +08:00
|
|
|
local ret = createLayerDemoLayer("LayerColor: cascading color")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer1 = cc.LayerColor:create(cc.c4b(255, 255, 255, 255), s.width, s.height/2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:setPosition( cc.p(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:addChild(sister1)
|
|
|
|
layer1:addChild(sister2)
|
|
|
|
layer1:addChild(label)
|
|
|
|
ret:addChild( layer1, 0, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, 0))
|
|
|
|
label:setPosition( cc.p( s.width/2, 0))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.RepeatForever:create(
|
|
|
|
cc.Sequence:create(cc.TintTo:create(6, 255, 0, 255),
|
|
|
|
cc.TintTo:create(6, 255, 255, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.RepeatForever:create(
|
|
|
|
cc.Sequence:create(cc.TintTo:create(2, 255, 255, 0),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.TintTo:create(2, 0, 255, 255),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.TintTo:create(2, 255, 0, 255),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- Enable cascading in scene
|
|
|
|
setEnableRecursiveCascading(ret, true)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerTestCascadingColorC
|
|
|
|
local function LayerTestCascadingColorC()
|
2013-08-16 10:12:46 +08:00
|
|
|
local ret = createLayerDemoLayer("LayerColor: non-cascading color")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer1 = cc.LayerColor:create(cc.c4b(255, 255, 255, 255), s.width, s.height/2)
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:setCascadeColorEnabled(false)
|
2013-08-16 10:12:46 +08:00
|
|
|
layer1:setPosition( cc.p(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:addChild(sister1)
|
|
|
|
layer1:addChild(sister2)
|
|
|
|
layer1:addChild(label)
|
|
|
|
ret:addChild( layer1, 0, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, 0))
|
|
|
|
label:setPosition( cc.p( s.width/2, 0))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.RepeatForever:create(
|
|
|
|
cc.Sequence:create(cc.TintTo:create(6, 255, 0, 255),
|
|
|
|
cc.TintTo:create(6, 255, 255, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.RepeatForever:create(
|
|
|
|
cc.Sequence:create(cc.TintTo:create(2, 255, 255, 0),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.TintTo:create(2, 0, 255, 255),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.TintTo:create(2, 255, 0, 255),
|
|
|
|
cc.TintTo:create(2, 255, 255, 255),
|
|
|
|
cc.DelayTime:create(1)
|
|
|
|
)))
|
2013-04-02 17:52:08 +08:00
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
--------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- LayerTest1
|
|
|
|
--
|
|
|
|
--------------------------------------------------------------------
|
|
|
|
local function LayerTest1()
|
|
|
|
local ret = createLayerDemoLayer("ColorLayer resize (tap & move)")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:setTouchEnabled(true)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer = cc.LayerColor:create( cc.c4b(0xFF, 0x00, 0x00, 0x80), 200, 200)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer:ignoreAnchorPointForPosition(false)
|
2013-08-16 10:12:46 +08:00
|
|
|
layer:setPosition( cc.p(s.width/2, s.height/2) )
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(layer, 1, kTagLayer)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function updateSize(x, y)
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local newSize = cc.size( math.abs(x - s.width/2)*2, math.abs(y - s.height/2)*2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2014-01-15 23:31:00 +08:00
|
|
|
local l = tolua.cast(ret:getChildByTag(kTagLayer), "cc.LayerColor")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
l:setContentSize( newSize )
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function onTouchEvent(eventType, x, y)
|
|
|
|
if eventType == "began" then
|
|
|
|
updateSize(x, y)
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
updateSize(x, y)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
ret:registerScriptTouchHandler(onTouchEvent)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
--------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- LayerTest2
|
|
|
|
--
|
|
|
|
--------------------------------------------------------------------
|
|
|
|
local function LayerTest2()
|
|
|
|
local ret = createLayerDemoLayer("ColorLayer: fade and tint")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer1 = cc.LayerColor:create( cc.c4b(255, 255, 0, 80), 100, 300)
|
|
|
|
layer1:setPosition(cc.p(s.width/3, s.height/2))
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:ignoreAnchorPointForPosition(false)
|
|
|
|
ret:addChild(layer1, 1)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local layer2 = cc.LayerColor:create( cc.c4b(0, 0, 255, 255), 100, 300)
|
|
|
|
layer2:setPosition(cc.p((s.width/3)*2, s.height/2))
|
2013-04-02 17:52:08 +08:00
|
|
|
layer2:ignoreAnchorPointForPosition(false)
|
|
|
|
ret:addChild(layer2, 1)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local actionTint = cc.TintBy:create(2, -255, -127, 0)
|
2013-04-02 17:52:08 +08:00
|
|
|
local actionTintBack = actionTint:reverse()
|
2013-08-16 10:12:46 +08:00
|
|
|
local seq1 = cc.Sequence:create(actionTint,actionTintBack)
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(seq1)
|
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local actionFade = cc.FadeOut:create(2.0)
|
2013-04-02 17:52:08 +08:00
|
|
|
local actionFadeBack = actionFade:reverse()
|
2013-08-16 10:12:46 +08:00
|
|
|
local seq2 = cc.Sequence:create(actionFade,actionFadeBack)
|
2013-04-02 17:52:08 +08:00
|
|
|
layer2:runAction(seq2)
|
|
|
|
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
--------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- LayerTestBlend
|
|
|
|
--
|
|
|
|
--------------------------------------------------------------------
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function LayerTestBlend()
|
|
|
|
local ret = createLayerDemoLayer("ColorLayer: blend")
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local layer1 = cc.LayerColor:create( cc.c4b(255, 255, 255, 80) )
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local sister1 = cc.Sprite:create(s_pPathSister1)
|
|
|
|
local sister2 = cc.Sprite:create(s_pPathSister2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(sister1)
|
|
|
|
ret:addChild(sister2)
|
|
|
|
ret:addChild(layer1, 100, kTagLayer)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
sister1:setPosition( cc.p( s.width*1/3, s.height/2) )
|
|
|
|
sister2:setPosition( cc.p( s.width*2/3, s.height/2) )
|
|
|
|
|
|
|
|
local blend = true
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function newBlend(dt)
|
2014-01-15 23:31:00 +08:00
|
|
|
local layer = tolua.cast(ret:getChildByTag(kTagLayer), "cc.LayerColor")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local src = 0
|
|
|
|
local dst = 0
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
if blend then
|
|
|
|
src = gl.SRC_ALPHA
|
|
|
|
dst = gl.ONE_MINUS_SRC_ALPHA
|
2013-04-02 17:52:08 +08:00
|
|
|
else
|
2013-08-16 10:12:46 +08:00
|
|
|
src = gl.ONE_MINUS_DST_COLOR
|
|
|
|
dst = gl.ZERO
|
2013-04-02 17:52:08 +08:00
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
layer:setBlendFunc(src, dst)
|
|
|
|
blend = not blend
|
2013-04-02 17:52:08 +08:00
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local schedulerEntry = nil
|
|
|
|
local function onNodeEvent(event)
|
|
|
|
if event == "enter" then
|
|
|
|
schedulerEntry = scheduler:scheduleScriptFunc(newBlend, 1.0, false)
|
|
|
|
elseif event == "exit" then
|
|
|
|
scheduler:unscheduleScriptEntry(schedulerEntry)
|
|
|
|
end
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:registerScriptHandler(onNodeEvent)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
--------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- LayerGradient
|
|
|
|
--
|
|
|
|
--------------------------------------------------------------------
|
|
|
|
local function LayerGradient()
|
|
|
|
local ret = createLayerDemoLayer("LayerGradient", "Touch the screen and move your finger")
|
2013-08-16 10:12:46 +08:00
|
|
|
local layer1 = cc.LayerGradient:create(cc.c4b(255,0,0,255), cc.c4b(0,255,0,255), cc.p(0.9, 0.9))
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(layer1, 0, kTagLayer)
|
|
|
|
|
|
|
|
ret:setTouchEnabled(true)
|
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local label1 = cc.LabelTTF:create("Compressed Interpolation: Enabled", "Marker Felt", 26)
|
|
|
|
local label2 = cc.LabelTTF:create("Compressed Interpolation: Disabled", "Marker Felt", 26)
|
|
|
|
local item1 = cc.MenuItemLabel:create(label1)
|
|
|
|
local item2 = cc.MenuItemLabel:create(label2)
|
|
|
|
local item = cc.MenuItemToggle:create(item1)
|
2013-04-02 17:52:08 +08:00
|
|
|
item:addSubItem(item2)
|
|
|
|
|
|
|
|
local function toggleItem(sender)
|
|
|
|
-- cclog("toggleItem")
|
2014-01-15 23:31:00 +08:00
|
|
|
local gradient = tolua.cast(ret:getChildByTag(kTagLayer), "cc.LayerGradient")
|
2013-04-02 17:52:08 +08:00
|
|
|
gradient:setCompressedInterpolation(not gradient:isCompressedInterpolation())
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
item:registerScriptTapHandler(toggleItem)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local menu = cc.Menu:create(item)
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(menu)
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
menu:setPosition(cc.p(s.width / 2, 100))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function onTouchEvent(eventType, x, y)
|
|
|
|
if eventType == "began" then
|
|
|
|
return true
|
|
|
|
elseif eventType == "moved" then
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
|
|
|
local start = cc.p(x, y)
|
|
|
|
local movingPos = cc.p(s.width/2,s.height/2)
|
|
|
|
local diff = cc.p(movingPos.x - start.x, movingPos.y - start.y)
|
|
|
|
diff = cc.pNormalize(diff)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2014-01-15 23:31:00 +08:00
|
|
|
local gradient = tolua.cast(ret:getChildByTag(1), "cc.LayerGradient")
|
2013-04-02 17:52:08 +08:00
|
|
|
gradient:setVector(diff)
|
|
|
|
end
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:registerScriptTouchHandler(onTouchEvent)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerIgnoreAnchorPointPos
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local kLayerIgnoreAnchorPoint = 1000
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function LayerIgnoreAnchorPointPos()
|
|
|
|
local ret = createLayerDemoLayer("IgnoreAnchorPoint - Position", "Ignoring Anchor Point for position")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local l = cc.LayerColor:create(cc.c4b(255, 0, 0, 255), 150, 150)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
l:setAnchorPoint(cc.p(0.5, 0.5))
|
|
|
|
l:setPosition(cc.p( s.width/2, s.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local move = cc.MoveBy:create(2, cc.p(100,2))
|
2014-01-15 23:31:00 +08:00
|
|
|
local back = tolua.cast(move:reverse(), "cc.MoveBy")
|
2013-08-16 10:12:46 +08:00
|
|
|
local seq = cc.Sequence:create(move, back)
|
|
|
|
l:runAction(cc.RepeatForever:create(seq))
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(l, 0, kLayerIgnoreAnchorPoint)
|
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local child = cc.Sprite:create("Images/grossini.png")
|
2013-04-02 17:52:08 +08:00
|
|
|
l:addChild(child)
|
|
|
|
local lsize = l:getContentSize()
|
2013-08-16 10:12:46 +08:00
|
|
|
child:setPosition(cc.p(lsize.width/2, lsize.height/2))
|
2013-04-02 17:52:08 +08:00
|
|
|
|
|
|
|
local function onToggle(pObject)
|
|
|
|
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
|
|
|
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
|
|
|
pLayer:ignoreAnchorPointForPosition(not ignore)
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
|
2013-04-02 17:52:08 +08:00
|
|
|
item:registerScriptTapHandler(onToggle)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local menu = cc.Menu:create(item)
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(menu)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
menu:setPosition(cc.p(s.width/2, s.height/2))
|
2013-04-02 17:52:08 +08:00
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerIgnoreAnchorPointRot
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function LayerIgnoreAnchorPointRot()
|
|
|
|
local ret = createLayerDemoLayer("IgnoreAnchorPoint - Rotation", "Ignoring Anchor Point for rotations")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local l = cc.LayerColor:create(cc.c4b(255, 0, 0, 255), 200, 200)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
l:setAnchorPoint(cc.p(0.5, 0.5))
|
|
|
|
l:setPosition(cc.p( s.width/2, s.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(l, 0, kLayerIgnoreAnchorPoint)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local rot = cc.RotateBy:create(2, 360)
|
|
|
|
l:runAction(cc.RepeatForever:create(rot))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local child = cc.Sprite:create("Images/grossini.png")
|
2013-04-02 17:52:08 +08:00
|
|
|
l:addChild(child)
|
|
|
|
local lsize = l:getContentSize()
|
2013-08-16 10:12:46 +08:00
|
|
|
child:setPosition(cc.p(lsize.width/2, lsize.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function onToggle(pObject)
|
|
|
|
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
|
|
|
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
|
|
|
pLayer:ignoreAnchorPointForPosition(not ignore)
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local item = cc.MenuItemFont:create("Toogle ignore anchor point")
|
2013-04-02 17:52:08 +08:00
|
|
|
item:registerScriptTapHandler(onToggle)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local menu = cc.Menu:create(item)
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(menu)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
menu:setPosition(cc.p(s.width/2, s.height/2))
|
2013-04-02 17:52:08 +08:00
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
-- LayerIgnoreAnchorPointScale
|
|
|
|
local function LayerIgnoreAnchorPointScale()
|
|
|
|
local ret = createLayerDemoLayer("IgnoreAnchorPoint - Scale", "Ignoring Anchor Point for scale")
|
2013-08-16 10:12:46 +08:00
|
|
|
local s = cc.Director:getInstance():getWinSize()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local l = cc.LayerColor:create(cc.c4b(255, 0, 0, 255), 200, 200)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
l:setAnchorPoint(cc.p(0.5, 1.0))
|
|
|
|
l:setPosition(cc.p( s.width/2, s.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local scale = cc.ScaleBy:create(2, 2)
|
2014-01-15 23:31:00 +08:00
|
|
|
local back = tolua.cast(scale:reverse(), "cc.ScaleBy")
|
2013-08-16 10:12:46 +08:00
|
|
|
local seq = cc.Sequence:create(scale, back)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
l:runAction(cc.RepeatForever:create(seq))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(l, 0, kLayerIgnoreAnchorPoint)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local child = cc.Sprite:create("Images/grossini.png")
|
2013-04-02 17:52:08 +08:00
|
|
|
l:addChild(child)
|
|
|
|
local lsize = l:getContentSize()
|
2013-08-16 10:12:46 +08:00
|
|
|
child:setPosition(cc.p(lsize.width/2, lsize.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function onToggle(pObject)
|
|
|
|
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
|
|
|
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
|
|
|
pLayer:ignoreAnchorPointForPosition(not ignore)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local item = cc.MenuItemFont:create("Toogle ignore anchor point")
|
2013-04-02 17:52:08 +08:00
|
|
|
item:registerScriptTapHandler(onToggle)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local menu = cc.Menu:create(item)
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(menu)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
menu:setPosition(cc.p(s.width/2, s.height/2))
|
2013-04-02 17:52:08 +08:00
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 11:28:31 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function LayerExtendedBlendOpacityTest()
|
|
|
|
local ret = createLayerDemoLayer("Extended Blend & Opacity", "You should see 3 layers")
|
2013-08-16 10:12:46 +08:00
|
|
|
local layer1 = cc.LayerGradient:create(cc.c4b(255, 0, 0, 255), cc.c4b(255, 0, 255, 255))
|
|
|
|
layer1:setContentSize(cc.size(80, 80))
|
|
|
|
layer1:setPosition(cc.p(50,50))
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(layer1)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local layer2 = cc.LayerGradient:create(cc.c4b(0, 0, 0, 127), cc.c4b(255, 255, 255, 127))
|
|
|
|
layer2:setContentSize(cc.size(80, 80))
|
|
|
|
layer2:setPosition(cc.p(100,90))
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(layer2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-08-16 10:12:46 +08:00
|
|
|
local layer3 = cc.LayerGradient:create()
|
|
|
|
layer3:setContentSize(cc.size(80, 80))
|
|
|
|
layer3:setPosition(cc.p(150,140))
|
|
|
|
layer3:setStartColor(cc.c3b(255, 0, 0))
|
|
|
|
layer3:setEndColor(cc.c3b(255, 0, 255))
|
2013-04-02 17:52:08 +08:00
|
|
|
layer3:setStartOpacity(255)
|
|
|
|
layer3:setEndOpacity(255)
|
2013-08-16 10:12:46 +08:00
|
|
|
layer3:setBlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
|
2013-04-02 17:52:08 +08:00
|
|
|
ret:addChild(layer3)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
function LayerTestMain()
|
|
|
|
cclog("LayerTestMain")
|
|
|
|
Helper.index = 1
|
2013-08-16 10:12:46 +08:00
|
|
|
cc.Director:getInstance():setDepthTest(true)
|
|
|
|
local scene = cc.Scene:create()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
Helper.createFunctionTable = {
|
|
|
|
LayerTestCascadingOpacityA,
|
2013-04-02 17:52:08 +08:00
|
|
|
LayerTestCascadingOpacityB,
|
|
|
|
LayerTestCascadingOpacityC,
|
|
|
|
LayerTestCascadingColorA,
|
|
|
|
LayerTestCascadingColorB,
|
|
|
|
LayerTestCascadingColorC,
|
|
|
|
LayerTest1,
|
|
|
|
LayerTest2,
|
|
|
|
LayerTestBlend,
|
|
|
|
LayerGradient,
|
|
|
|
LayerIgnoreAnchorPointPos,
|
|
|
|
LayerIgnoreAnchorPointRot,
|
|
|
|
LayerIgnoreAnchorPointScale,
|
|
|
|
LayerExtendedBlendOpacityTest
|
2013-04-01 18:05:35 +08:00
|
|
|
}
|
|
|
|
scene:addChild(LayerTestCascadingOpacityA())
|
|
|
|
scene:addChild(CreateBackMenuItem())
|
|
|
|
return scene
|
|
|
|
end
|