2013-04-02 17:52:08 +08:00
|
|
|
local scheduler = CCDirector:sharedDirector():getScheduler()
|
2013-04-02 11:28:31 +08:00
|
|
|
local kTagLayer = 1
|
|
|
|
|
|
|
|
local function createLayerDemoLayer(title, subtitle)
|
|
|
|
local layer = CCLayer:create()
|
|
|
|
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
|
|
|
|
|
|
|
|
-- node:setPosition( ccpAdd(ccp(newX, newY), ccp(diffX, diffY)) )
|
|
|
|
-- 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
|
|
|
|
|
|
|
|
if node.__CCRGBAProtocol__ ~= nil then
|
|
|
|
node.__CCRGBAProtocol__:setCascadeColorEnabled(enable)
|
|
|
|
node.__CCRGBAProtocol__: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")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2013-04-02 11:28:31 +08:00
|
|
|
local i = 0
|
|
|
|
local len = children:count()
|
|
|
|
for i = 0, len-1, 1 do
|
|
|
|
local child = tolua.cast(children:objectAtIndex(i), "CCNode")
|
2013-04-01 18:05:35 +08:00
|
|
|
setEnableRecursiveCascading(child, enable)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- LayerTestCascadingOpacityA
|
2013-04-02 11:28:31 +08:00
|
|
|
local function LayerTestCascadingOpacityA()
|
|
|
|
local ret = createLayerDemoLayer("LayerRGBA: cascading opacity")
|
2013-04-01 18:05:35 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerRGBA:create()
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-01 18:05:35 +08:00
|
|
|
local sister1 = CCSprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = CCSprite:create("Images/grossinis_sister2.png")
|
2013-04-02 17:52:08 +08:00
|
|
|
local label = CCLabelBMFont: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-04-01 18:05:35 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, s.height/2))
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, s.height/2))
|
|
|
|
label:setPosition( ccp( s.width/2, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 11:28:31 +08:00
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(CCFadeTo:create(4, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(4, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
|
|
|
layer1:runAction(CCRepeatForever:create(CCSequence:create(arr)))
|
2013-04-02 17:52:08 +08:00
|
|
|
|
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(CCFadeTo:create(2, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 255))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
|
|
|
sister1:runAction(CCRepeatForever:create(CCSequence:create(arr)))
|
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-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerColor:create(ccc4(192, 0, 0, 255), s.width, s.height/2)
|
|
|
|
layer1:setCascadeColorEnabled(false)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:setPosition( ccp(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local sister1 = CCSprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = CCSprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = CCLabelBMFont: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-04-02 17:52:08 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, 0))
|
|
|
|
label:setPosition( ccp( s.width/2, 0))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(CCFadeTo:create(4, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(4, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(CCRepeatForever:create(CCSequence:create(arr)))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(CCFadeTo:create(2, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 255))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(CCRepeatForever:create(CCSequence:create(arr)))
|
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()
|
|
|
|
local ret = createLayerDemoLayer("CCLayerColor: non-cascading opacity")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerColor:create(ccc4(192, 0, 0, 255), s.width, s.height/2)
|
|
|
|
layer1:setCascadeColorEnabled(false)
|
|
|
|
layer1:setCascadeOpacityEnabled(false)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:setPosition( ccp(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local sister1 = CCSprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = CCSprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = CCLabelBMFont: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-04-02 17:52:08 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, 0))
|
|
|
|
label:setPosition( ccp( s.width/2, 0))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(CCFadeTo:create(4, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(4, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(arr
|
|
|
|
)))
|
|
|
|
|
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(CCFadeTo:create(2, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 255))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 0))
|
|
|
|
arr:addObject(CCFadeTo:create(2, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(arr)))
|
|
|
|
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()
|
|
|
|
local ret = createLayerDemoLayer("LayerRGBA: cascading color")
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerRGBA:create()
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local sister1 = CCSprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = CCSprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = CCLabelBMFont: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-04-02 17:52:08 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, s.height/2))
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, s.height/2))
|
|
|
|
label:setPosition( ccp( s.width/2, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(CCTintTo:create(6, 255, 0, 255))
|
|
|
|
arr:addObject(CCTintTo:create(6, 255, 255, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(arr
|
|
|
|
)))
|
|
|
|
|
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 0))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 0, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 0, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(
|
|
|
|
arr)))
|
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()
|
|
|
|
local ret = createLayerDemoLayer("CCLayerColor: cascading color")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerColor:create(ccc4(255, 255, 255, 255), s.width, s.height/2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:setPosition( ccp(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local sister1 = CCSprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = CCSprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = CCLabelBMFont: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-04-02 17:52:08 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, 0))
|
|
|
|
label:setPosition( ccp( s.width/2, 0))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(CCTintTo:create(6, 255, 0, 255))
|
|
|
|
arr:addObject(CCTintTo:create(6, 255, 255, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(
|
|
|
|
arr)))
|
|
|
|
|
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 0))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 0, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 0, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(
|
|
|
|
arr)))
|
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()
|
|
|
|
local ret = createLayerDemoLayer("CCLayerColor: non-cascading color")
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerColor:create(ccc4(255, 255, 255, 255), s.width, s.height/2)
|
|
|
|
layer1:setCascadeColorEnabled(false)
|
|
|
|
layer1:setPosition( ccp(0, s.height/2))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local sister1 = CCSprite:create("Images/grossinis_sister1.png")
|
|
|
|
local sister2 = CCSprite:create("Images/grossinis_sister2.png")
|
|
|
|
local label = CCLabelBMFont: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-04-02 17:52:08 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, 0))
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, 0))
|
|
|
|
label:setPosition( ccp( s.width/2, 0))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(CCTintTo:create(6, 255, 0, 255))
|
|
|
|
arr:addObject(CCTintTo:create(6, 255, 255, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(
|
|
|
|
arr)))
|
|
|
|
|
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 0))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 0, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 0, 255))
|
|
|
|
arr:addObject(CCTintTo:create(2, 255, 255, 255))
|
|
|
|
arr:addObject(CCDelayTime:create(1))
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
sister1:runAction(
|
|
|
|
CCRepeatForever:create(
|
|
|
|
CCSequence:create(
|
|
|
|
arr)))
|
|
|
|
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-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
2013-04-05 16:13:04 +08:00
|
|
|
local layer = CCLayerColor:create( ccc4(0xFF, 0x00, 0x00, 0x80), 200, 200)
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
layer:ignoreAnchorPointForPosition(false)
|
|
|
|
layer:setPosition( ccp(s.width/2, s.height/2) )
|
|
|
|
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)
|
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local newSize = CCSizeMake( math.abs(x - s.width/2)*2, math.abs(y - s.height/2)*2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local l = tolua.cast(ret:getChildByTag(kTagLayer), "CCLayerColor")
|
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-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerColor:create( ccc4(255, 255, 0, 80), 100, 300)
|
|
|
|
layer1:setPosition(ccp(s.width/3, s.height/2))
|
|
|
|
layer1:ignoreAnchorPointForPosition(false)
|
|
|
|
ret:addChild(layer1, 1)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local layer2 = CCLayerColor:create( ccc4(0, 0, 255, 255), 100, 300)
|
|
|
|
layer2:setPosition(ccp((s.width/3)*2, s.height/2))
|
|
|
|
layer2:ignoreAnchorPointForPosition(false)
|
|
|
|
ret:addChild(layer2, 1)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local actionTint = CCTintBy:create(2, -255, -127, 0)
|
|
|
|
local actionTintBack = actionTint:reverse()
|
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(actionTint)
|
|
|
|
arr:addObject(actionTintBack)
|
|
|
|
local seq1 = CCSequence:create(arr)
|
|
|
|
layer1:runAction(seq1)
|
|
|
|
|
|
|
|
local actionFade = CCFadeOut:create(2.0)
|
|
|
|
local actionFadeBack = actionFade:reverse()
|
|
|
|
arr = CCArray:create()
|
|
|
|
arr:addObject(actionFade)
|
|
|
|
arr:addObject(actionFadeBack)
|
|
|
|
local seq2 = CCSequence:create(arr)
|
|
|
|
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")
|
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local layer1 = CCLayerColor:create( ccc4(255, 255, 255, 80) )
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local sister1 = CCSprite:create(s_pPathSister1)
|
|
|
|
local sister2 = CCSprite: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-04-02 17:52:08 +08:00
|
|
|
sister1:setPosition( ccp( s.width*1/3, s.height/2) )
|
|
|
|
sister2:setPosition( ccp( s.width*2/3, s.height/2) )
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local function newBlend(dt)
|
|
|
|
local layer = tolua.cast(ret:getChildByTag(kTagLayer), "CCLayerColor")
|
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-04-02 17:52:08 +08:00
|
|
|
if layer:getBlendFunc().dst == GL_ZERO then
|
|
|
|
src = GL_SRC_ALPHA
|
|
|
|
dst = GL_ONE_MINUS_SRC_ALPHA
|
|
|
|
else
|
|
|
|
src = GL_ONE_MINUS_DST_COLOR
|
|
|
|
dst = GL_ZERO
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local bf = ccBlendFunc()
|
|
|
|
bf.src = src
|
|
|
|
bf.dst = dst
|
|
|
|
layer:setBlendFunc( bf )
|
|
|
|
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")
|
|
|
|
local layer1 = CCLayerGradient:create(ccc4(255,0,0,255), ccc4(0,255,0,255), ccp(0.9, 0.9))
|
|
|
|
ret:addChild(layer1, 0, kTagLayer)
|
|
|
|
|
|
|
|
ret:setTouchEnabled(true)
|
|
|
|
|
|
|
|
local label1 = CCLabelTTF:create("Compressed Interpolation: Enabled", "Marker Felt", 26)
|
|
|
|
local label2 = CCLabelTTF:create("Compressed Interpolation: Disabled", "Marker Felt", 26)
|
|
|
|
local item1 = CCMenuItemLabel:create(label1)
|
|
|
|
local item2 = CCMenuItemLabel:create(label2)
|
|
|
|
local item = CCMenuItemToggle:create(item1)
|
|
|
|
item:addSubItem(item2)
|
|
|
|
|
|
|
|
local function toggleItem(sender)
|
|
|
|
-- cclog("toggleItem")
|
|
|
|
local gradient = tolua.cast(ret:getChildByTag(kTagLayer), "CCLayerGradient")
|
|
|
|
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-04-02 17:52:08 +08:00
|
|
|
local menu = CCMenu:createWithItem(item)
|
|
|
|
ret:addChild(menu)
|
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
menu:setPosition(ccp(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
|
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
|
|
|
local start = ccp(x, y)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-05 16:13:04 +08:00
|
|
|
local diff = ccpSub( ccp(s.width/2,s.height/2), start)
|
2013-04-02 17:52:08 +08:00
|
|
|
diff = ccpNormalize(diff)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local gradient = tolua.cast(ret:getChildByTag(1), "CCLayerGradient")
|
|
|
|
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-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local l = CCLayerColor:create(ccc4(255, 0, 0, 255), 150, 150)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
l:setAnchorPoint(ccp(0.5, 0.5))
|
|
|
|
l:setPosition(ccp( s.width/2, s.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local move = CCMoveBy:create(2, ccp(100,2))
|
|
|
|
local back = tolua.cast(move:reverse(), "CCMoveBy")
|
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(move)
|
|
|
|
arr:addObject(back)
|
|
|
|
local seq = CCSequence:create(arr)
|
|
|
|
l:runAction(CCRepeatForever:create(seq))
|
|
|
|
ret:addChild(l, 0, kLayerIgnoreAnchorPoint)
|
|
|
|
|
|
|
|
local child = CCSprite:create("Images/grossini.png")
|
|
|
|
l:addChild(child)
|
|
|
|
local lsize = l:getContentSize()
|
|
|
|
child:setPosition(ccp(lsize.width/2, lsize.height/2))
|
|
|
|
|
|
|
|
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-04-02 17:52:08 +08:00
|
|
|
local item = CCMenuItemFont:create("Toggle ignore anchor point")
|
|
|
|
item:registerScriptTapHandler(onToggle)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local menu = CCMenu:createWithItem(item)
|
|
|
|
ret:addChild(menu)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
menu:setPosition(ccp(s.width/2, s.height/2))
|
|
|
|
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-04-02 17:52:08 +08:00
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local l = CCLayerColor:create(ccc4(255, 0, 0, 255), 200, 200)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
l:setAnchorPoint(ccp(0.5, 0.5))
|
|
|
|
l:setPosition(ccp( 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-04-02 17:52:08 +08:00
|
|
|
local rot = CCRotateBy:create(2, 360)
|
|
|
|
l:runAction(CCRepeatForever:create(rot))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local child = CCSprite:create("Images/grossini.png")
|
|
|
|
l:addChild(child)
|
|
|
|
local lsize = l:getContentSize()
|
|
|
|
child:setPosition(ccp(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-04-02 17:52:08 +08:00
|
|
|
local item = CCMenuItemFont:create("Toogle ignore anchor point")
|
|
|
|
item:registerScriptTapHandler(onToggle)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local menu = CCMenu:createWithItem(item)
|
|
|
|
ret:addChild(menu)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
menu:setPosition(ccp(s.width/2, s.height/2))
|
|
|
|
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")
|
|
|
|
local s = CCDirector:sharedDirector():getWinSize()
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local l = CCLayerColor:create(ccc4(255, 0, 0, 255), 200, 200)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
l:setAnchorPoint(ccp(0.5, 1.0))
|
|
|
|
l:setPosition(ccp( s.width/2, s.height/2))
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local scale = CCScaleBy:create(2, 2)
|
|
|
|
local back = tolua.cast(scale:reverse(), "CCScaleBy")
|
|
|
|
local arr = CCArray:create()
|
|
|
|
arr:addObject(scale)
|
|
|
|
arr:addObject(back)
|
|
|
|
local seq = CCSequence:create(arr)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
l:runAction(CCRepeatForever: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-04-02 17:52:08 +08:00
|
|
|
local child = CCSprite:create("Images/grossini.png")
|
|
|
|
l:addChild(child)
|
|
|
|
local lsize = l:getContentSize()
|
|
|
|
child:setPosition(ccp(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-04-02 17:52:08 +08:00
|
|
|
local item = CCMenuItemFont:create("Toogle ignore anchor point")
|
|
|
|
item:registerScriptTapHandler(onToggle)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local menu = CCMenu:createWithItem(item)
|
|
|
|
ret:addChild(menu)
|
2013-04-01 18:05:35 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
menu:setPosition(ccp(s.width/2, s.height/2))
|
|
|
|
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")
|
|
|
|
local layer1 = CCLayerGradient:create(ccc4(255, 0, 0, 255), ccc4(255, 0, 255, 255))
|
|
|
|
layer1:setContentSize(CCSizeMake(80, 80))
|
|
|
|
layer1:setPosition(ccp(50,50))
|
|
|
|
ret:addChild(layer1)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local layer2 = CCLayerGradient:create(ccc4(0, 0, 0, 127), ccc4(255, 255, 255, 127))
|
|
|
|
layer2:setContentSize(CCSizeMake(80, 80))
|
|
|
|
layer2:setPosition(ccp(100,90))
|
|
|
|
ret:addChild(layer2)
|
2013-04-05 16:13:04 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
local layer3 = CCLayerGradient:create()
|
|
|
|
layer3:setContentSize(CCSizeMake(80, 80))
|
|
|
|
layer3:setPosition(ccp(150,140))
|
|
|
|
layer3:setStartColor(ccc3(255, 0, 0))
|
|
|
|
layer3:setEndColor(ccc3(255, 0, 255))
|
|
|
|
layer3:setStartOpacity(255)
|
|
|
|
layer3:setEndOpacity(255)
|
|
|
|
local blend = ccBlendFunc()
|
|
|
|
blend.src = GL_SRC_ALPHA
|
|
|
|
blend.dst = GL_ONE_MINUS_SRC_ALPHA
|
|
|
|
layer3:setBlendFunc(blend)
|
|
|
|
ret:addChild(layer3)
|
|
|
|
return ret
|
|
|
|
end
|
2013-04-01 18:05:35 +08:00
|
|
|
|
|
|
|
function LayerTestMain()
|
|
|
|
cclog("LayerTestMain")
|
|
|
|
Helper.index = 1
|
|
|
|
CCDirector:sharedDirector():setDepthTest(true)
|
|
|
|
local scene = CCScene:create()
|
|
|
|
|
|
|
|
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
|