mirror of https://github.com/axmolengine/axmol.git
update deprecated calls
This commit is contained in:
parent
82e9024e94
commit
ad0ffc205c
|
@ -181,7 +181,7 @@ local function ActionRotationalSkewVSStandardSkew()
|
||||||
local box = cc.LayerColor:create(cc.c4b(255,255,0,255));
|
local box = cc.LayerColor:create(cc.c4b(255,255,0,255));
|
||||||
box:setAnchorPoint(cc.p(0.5,0.5));
|
box:setAnchorPoint(cc.p(0.5,0.5));
|
||||||
box:setContentSize( boxSize );
|
box:setContentSize( boxSize );
|
||||||
box:ignoreAnchorPointForPosition(false);
|
box:setIgnoreAnchorPointForPosition(false);
|
||||||
box:setPosition(cc.p(s.width/2, s.height - 100 - box:getContentSize().height/2));
|
box:setPosition(cc.p(s.width/2, s.height - 100 - box:getContentSize().height/2));
|
||||||
layer:addChild(box);
|
layer:addChild(box);
|
||||||
local label = cc.Label:createWithTTF("Standard cocos2d Skew", s_markerFeltFontPath, 16);
|
local label = cc.Label:createWithTTF("Standard cocos2d Skew", s_markerFeltFontPath, 16);
|
||||||
|
@ -197,7 +197,7 @@ local function ActionRotationalSkewVSStandardSkew()
|
||||||
box = cc.LayerColor:create(cc.c4b(255,255,0,255));
|
box = cc.LayerColor:create(cc.c4b(255,255,0,255));
|
||||||
box:setAnchorPoint(cc.p(0.5,0.5));
|
box:setAnchorPoint(cc.p(0.5,0.5));
|
||||||
box:setContentSize(boxSize);
|
box:setContentSize(boxSize);
|
||||||
box:ignoreAnchorPointForPosition(false);
|
box:setIgnoreAnchorPointForPosition(false);
|
||||||
box:setPosition(cc.p(s.width/2, s.height - 250 - box:getContentSize().height/2));
|
box:setPosition(cc.p(s.width/2, s.height - 250 - box:getContentSize().height/2));
|
||||||
layer:addChild(box);
|
layer:addChild(box);
|
||||||
label = cc.Label:createWithTTF("Rotational Skew", s_markerFeltFontPath, 16);
|
label = cc.Label:createWithTTF("Rotational Skew", s_markerFeltFontPath, 16);
|
||||||
|
|
|
@ -117,18 +117,18 @@ local function BugTest458()
|
||||||
local nX,nY = pCorner:getPosition()
|
local nX,nY = pCorner:getPosition()
|
||||||
local pCorner2 = cc.Sprite:create("Images/bugs/corner.png")
|
local pCorner2 = cc.Sprite:create("Images/bugs/corner.png")
|
||||||
pCorner2:setPosition(cc.p(-nX, nY))
|
pCorner2:setPosition(cc.p(-nX, nY))
|
||||||
pCorner2:setFlipX(true)
|
pCorner2:setFlippedX(true)
|
||||||
pSprite:addChild(pCorner2)
|
pSprite:addChild(pCorner2)
|
||||||
|
|
||||||
local pCorner3 = cc.Sprite:create("Images/bugs/corner.png")
|
local pCorner3 = cc.Sprite:create("Images/bugs/corner.png")
|
||||||
pCorner3:setPosition(cc.p(nX, -nY))
|
pCorner3:setPosition(cc.p(nX, -nY))
|
||||||
pCorner3:setFlipY(true)
|
pCorner3:setFlippedY(true)
|
||||||
pSprite:addChild(pCorner3)
|
pSprite:addChild(pCorner3)
|
||||||
|
|
||||||
local pCorner4 = cc.Sprite:create("Images/bugs/corner.png")
|
local pCorner4 = cc.Sprite:create("Images/bugs/corner.png")
|
||||||
pCorner4:setPosition(cc.p(-nX, -nY))
|
pCorner4:setPosition(cc.p(-nX, -nY))
|
||||||
pCorner4:setFlipX(true)
|
pCorner4:setFlippedX(true)
|
||||||
pCorner4:setFlipY(true)
|
pCorner4:setFlippedY(true)
|
||||||
pSprite:addChild(pCorner4)
|
pSprite:addChild(pCorner4)
|
||||||
|
|
||||||
local pEdge = cc.Sprite:create("Images/bugs/edge.png")
|
local pEdge = cc.Sprite:create("Images/bugs/edge.png")
|
||||||
|
@ -139,7 +139,7 @@ local function BugTest458()
|
||||||
local pEdge2 = cc.Sprite:create("Images/bugs/edge.png")
|
local pEdge2 = cc.Sprite:create("Images/bugs/edge.png")
|
||||||
pEdge2:setScaleX(nWidth)
|
pEdge2:setScaleX(nWidth)
|
||||||
pEdge2:setPosition(cc.p(nX + (pCorner:getContentSize().width / 2) + (nWidth / 2), -nY))
|
pEdge2:setPosition(cc.p(nX + (pCorner:getContentSize().width / 2) + (nWidth / 2), -nY))
|
||||||
pEdge2:setFlipY(true)
|
pEdge2:setFlippedY(true)
|
||||||
pSprite:addChild(pEdge2)
|
pSprite:addChild(pEdge2)
|
||||||
|
|
||||||
local pEdge3 = cc.Sprite:create("Images/bugs/edge.png")
|
local pEdge3 = cc.Sprite:create("Images/bugs/edge.png")
|
||||||
|
@ -307,7 +307,7 @@ local function BugTest914()
|
||||||
layerColor:setContentSize(cc.size(i*100, i*100))
|
layerColor:setContentSize(cc.size(i*100, i*100))
|
||||||
layerColor:setPosition(cc.p(Winsize.width/2, Winsize.height/2))
|
layerColor:setPosition(cc.p(Winsize.width/2, Winsize.height/2))
|
||||||
layerColor:setAnchorPoint(cc.p(0.5, 0.5))
|
layerColor:setAnchorPoint(cc.p(0.5, 0.5))
|
||||||
layerColor:ignoreAnchorPointForPosition(false)
|
layerColor:setIgnoreAnchorPointForPosition(false)
|
||||||
layer:addChild(layerColor, -1-i)
|
layer:addChild(layerColor, -1-i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ local function BugTest1159()
|
||||||
|
|
||||||
local sprite_a = cc.LayerColor:create(cc.c4b(255, 0, 0, 255), 700, 700)
|
local sprite_a = cc.LayerColor:create(cc.c4b(255, 0, 0, 255), 700, 700)
|
||||||
sprite_a:setAnchorPoint(cc.p(0.5, 0.5))
|
sprite_a:setAnchorPoint(cc.p(0.5, 0.5))
|
||||||
sprite_a:ignoreAnchorPointForPosition(false)
|
sprite_a:setIgnoreAnchorPointForPosition(false)
|
||||||
sprite_a:setPosition(cc.p(0.0, Winsize.height/2))
|
sprite_a:setPosition(cc.p(0.0, Winsize.height/2))
|
||||||
pLayer:addChild(sprite_a)
|
pLayer:addChild(sprite_a)
|
||||||
local seq = cc.Sequence:create(cc.MoveTo:create(1.0, cc.p(1024.0, 384.0)), cc.MoveTo:create(1.0, cc.p(0.0, 384.0)))
|
local seq = cc.Sequence:create(cc.MoveTo:create(1.0, cc.p(1024.0, 384.0)), cc.MoveTo:create(1.0, cc.p(0.0, 384.0)))
|
||||||
|
@ -370,7 +370,7 @@ local function BugTest1159()
|
||||||
|
|
||||||
local sprite_b = cc.LayerColor:create(cc.c4b(0, 0, 255, 255), 400, 400)
|
local sprite_b = cc.LayerColor:create(cc.c4b(0, 0, 255, 255), 400, 400)
|
||||||
sprite_b:setAnchorPoint(cc.p(0.5, 0.5))
|
sprite_b:setAnchorPoint(cc.p(0.5, 0.5))
|
||||||
sprite_b:ignoreAnchorPointForPosition(false)
|
sprite_b:setIgnoreAnchorPointForPosition(false)
|
||||||
sprite_b:setPosition(cc.p(Winsize.width/2, Winsize.height/2))
|
sprite_b:setPosition(cc.p(Winsize.width/2, Winsize.height/2))
|
||||||
pLayer:addChild(sprite_b)
|
pLayer:addChild(sprite_b)
|
||||||
|
|
||||||
|
@ -620,6 +620,7 @@ local function BugsTestMainLayer()
|
||||||
local i = 1
|
local i = 1
|
||||||
for i = 1, nTestCount do
|
for i = 1, nTestCount do
|
||||||
local label = cc.Label:createWithTTF(testNames[i], s_arialPath, 24)
|
local label = cc.Label:createWithTTF(testNames[i], s_arialPath, 24)
|
||||||
|
print("test label index " .. i)
|
||||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||||
local pMenuItem = cc.MenuItemLabel:create(label)
|
local pMenuItem = cc.MenuItemLabel:create(label)
|
||||||
pMenuItem:registerScriptTapHandler(menuCallback)
|
pMenuItem:registerScriptTapHandler(menuCallback)
|
||||||
|
|
|
@ -311,7 +311,7 @@ local function LayerTest1()
|
||||||
local s = cc.Director:getInstance():getWinSize()
|
local s = cc.Director:getInstance():getWinSize()
|
||||||
local layer = cc.LayerColor:create( cc.c4b(0xFF, 0x00, 0x00, 0x80), 200, 200)
|
local layer = cc.LayerColor:create( cc.c4b(0xFF, 0x00, 0x00, 0x80), 200, 200)
|
||||||
|
|
||||||
layer:ignoreAnchorPointForPosition(false)
|
layer:setIgnoreAnchorPointForPosition(false)
|
||||||
layer:setPosition( cc.p(s.width/2, s.height/2) )
|
layer:setPosition( cc.p(s.width/2, s.height/2) )
|
||||||
ret:addChild(layer, 1, kTagLayer)
|
ret:addChild(layer, 1, kTagLayer)
|
||||||
|
|
||||||
|
@ -356,12 +356,12 @@ local function LayerTest2()
|
||||||
local s = cc.Director:getInstance():getWinSize()
|
local s = cc.Director:getInstance():getWinSize()
|
||||||
local layer1 = cc.LayerColor:create( cc.c4b(255, 255, 0, 80), 100, 300)
|
local layer1 = cc.LayerColor:create( cc.c4b(255, 255, 0, 80), 100, 300)
|
||||||
layer1:setPosition(cc.p(s.width/3, s.height/2))
|
layer1:setPosition(cc.p(s.width/3, s.height/2))
|
||||||
layer1:ignoreAnchorPointForPosition(false)
|
layer1:setIgnoreAnchorPointForPosition(false)
|
||||||
ret:addChild(layer1, 1)
|
ret:addChild(layer1, 1)
|
||||||
|
|
||||||
local layer2 = cc.LayerColor:create( cc.c4b(0, 0, 255, 255), 100, 300)
|
local layer2 = cc.LayerColor:create( cc.c4b(0, 0, 255, 255), 100, 300)
|
||||||
layer2:setPosition(cc.p((s.width/3)*2, s.height/2))
|
layer2:setPosition(cc.p((s.width/3)*2, s.height/2))
|
||||||
layer2:ignoreAnchorPointForPosition(false)
|
layer2:setIgnoreAnchorPointForPosition(false)
|
||||||
ret:addChild(layer2, 1)
|
ret:addChild(layer2, 1)
|
||||||
|
|
||||||
local actionTint = cc.TintBy:create(2, -255, -127, 0)
|
local actionTint = cc.TintBy:create(2, -255, -127, 0)
|
||||||
|
@ -513,7 +513,7 @@ local function LayerIgnoreAnchorPointPos()
|
||||||
local function onToggle(pObject)
|
local function onToggle(pObject)
|
||||||
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
||||||
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
||||||
pLayer:ignoreAnchorPointForPosition(not ignore)
|
pLayer:setIgnoreAnchorPointForPosition(not ignore)
|
||||||
end
|
end
|
||||||
|
|
||||||
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
|
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
|
||||||
|
@ -552,7 +552,7 @@ local function LayerIgnoreAnchorPointRot()
|
||||||
local function onToggle(pObject)
|
local function onToggle(pObject)
|
||||||
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
||||||
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
||||||
pLayer:ignoreAnchorPointForPosition(not ignore)
|
pLayer:setIgnoreAnchorPointForPosition(not ignore)
|
||||||
end
|
end
|
||||||
|
|
||||||
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
|
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
|
||||||
|
@ -592,7 +592,7 @@ local function LayerIgnoreAnchorPointScale()
|
||||||
local function onToggle(pObject)
|
local function onToggle(pObject)
|
||||||
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
|
||||||
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
local ignore = pLayer:isIgnoreAnchorPointForPosition()
|
||||||
pLayer:ignoreAnchorPointForPosition(not ignore)
|
pLayer:setIgnoreAnchorPointForPosition(not ignore)
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ end
|
||||||
|
|
||||||
-- sprite:setPosition(cc.p(256, 256))
|
-- sprite:setPosition(cc.p(256, 256))
|
||||||
-- sprite:setOpacity(182)
|
-- sprite:setOpacity(182)
|
||||||
-- sprite:setFlipY(1)
|
-- sprite:setFlippedY(1)
|
||||||
-- this:addChild(sprite, 999999)
|
-- this:addChild(sprite, 999999)
|
||||||
-- sprite:setColor(cc.c3b::GREEN)
|
-- sprite:setColor(cc.c3b::GREEN)
|
||||||
|
|
||||||
|
|
|
@ -264,8 +264,8 @@ function SpriteFrameTest.onEnter()
|
||||||
local animation = cc.Animation:createWithSpriteFrames(animFrames, 0.3)
|
local animation = cc.Animation:createWithSpriteFrames(animFrames, 0.3)
|
||||||
SpriteFrameTest.m_pSprite1:runAction( cc.RepeatForever:create( cc.Animate:create(animation) ) )
|
SpriteFrameTest.m_pSprite1:runAction( cc.RepeatForever:create( cc.Animate:create(animation) ) )
|
||||||
|
|
||||||
SpriteFrameTest.m_pSprite1:setFlipX(false)
|
SpriteFrameTest.m_pSprite1:setFlippedX(false)
|
||||||
SpriteFrameTest.m_pSprite1:setFlipY(false)
|
SpriteFrameTest.m_pSprite1:setFlippedY(false)
|
||||||
|
|
||||||
SpriteFrameTest.m_pSprite2 = cc.Sprite:createWithSpriteFrameName("grossini_dance_01.png")
|
SpriteFrameTest.m_pSprite2 = cc.Sprite:createWithSpriteFrameName("grossini_dance_01.png")
|
||||||
SpriteFrameTest.m_pSprite2:setPosition( cc.p( s.width/2 + 80, s.height/2) )
|
SpriteFrameTest.m_pSprite2:setPosition( cc.p( s.width/2 + 80, s.height/2) )
|
||||||
|
@ -292,8 +292,8 @@ function SpriteFrameTest.onEnter()
|
||||||
|
|
||||||
SpriteFrameTest.m_pSprite2:runAction(cc.RepeatForever:create( cc.Animate:create(animMixed) ) )
|
SpriteFrameTest.m_pSprite2:runAction(cc.RepeatForever:create( cc.Animate:create(animMixed) ) )
|
||||||
|
|
||||||
SpriteFrameTest.m_pSprite2:setFlipX(false)
|
SpriteFrameTest.m_pSprite2:setFlippedX(false)
|
||||||
SpriteFrameTest.m_pSprite2:setFlipY(false)
|
SpriteFrameTest.m_pSprite2:setFlippedY(false)
|
||||||
|
|
||||||
|
|
||||||
performWithDelay(Helper.currentLayer,SpriteFrameTest.startIn05Secs, 0.5)
|
performWithDelay(Helper.currentLayer,SpriteFrameTest.startIn05Secs, 0.5)
|
||||||
|
@ -332,10 +332,10 @@ function SpriteFrameTest.flipSprites(dt)
|
||||||
fy = true
|
fy = true
|
||||||
end
|
end
|
||||||
|
|
||||||
SpriteFrameTest.m_pSprite1:setFlipX(fx)
|
SpriteFrameTest.m_pSprite1:setFlippedX(fx)
|
||||||
SpriteFrameTest.m_pSprite1:setFlipY(fy)
|
SpriteFrameTest.m_pSprite1:setFlippedY(fy)
|
||||||
SpriteFrameTest.m_pSprite2:setFlipX(fx)
|
SpriteFrameTest.m_pSprite2:setFlippedX(fx)
|
||||||
SpriteFrameTest.m_pSprite2:setFlipY(fy)
|
SpriteFrameTest.m_pSprite2:setFlippedY(fy)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue