update deprecated calls

This commit is contained in:
Arnold 2019-06-10 14:34:26 +08:00
parent 82e9024e94
commit ad0ffc205c
No known key found for this signature in database
GPG Key ID: 2008D1CC4BD1AE60
5 changed files with 26 additions and 25 deletions

View File

@ -181,7 +181,7 @@ local function ActionRotationalSkewVSStandardSkew()
local box = cc.LayerColor:create(cc.c4b(255,255,0,255));
box:setAnchorPoint(cc.p(0.5,0.5));
box:setContentSize( boxSize );
box:ignoreAnchorPointForPosition(false);
box:setIgnoreAnchorPointForPosition(false);
box:setPosition(cc.p(s.width/2, s.height - 100 - box:getContentSize().height/2));
layer:addChild(box);
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:setAnchorPoint(cc.p(0.5,0.5));
box:setContentSize(boxSize);
box:ignoreAnchorPointForPosition(false);
box:setIgnoreAnchorPointForPosition(false);
box:setPosition(cc.p(s.width/2, s.height - 250 - box:getContentSize().height/2));
layer:addChild(box);
label = cc.Label:createWithTTF("Rotational Skew", s_markerFeltFontPath, 16);

View File

@ -117,18 +117,18 @@ local function BugTest458()
local nX,nY = pCorner:getPosition()
local pCorner2 = cc.Sprite:create("Images/bugs/corner.png")
pCorner2:setPosition(cc.p(-nX, nY))
pCorner2:setFlipX(true)
pCorner2:setFlippedX(true)
pSprite:addChild(pCorner2)
local pCorner3 = cc.Sprite:create("Images/bugs/corner.png")
pCorner3:setPosition(cc.p(nX, -nY))
pCorner3:setFlipY(true)
pCorner3:setFlippedY(true)
pSprite:addChild(pCorner3)
local pCorner4 = cc.Sprite:create("Images/bugs/corner.png")
pCorner4:setPosition(cc.p(-nX, -nY))
pCorner4:setFlipX(true)
pCorner4:setFlipY(true)
pCorner4:setFlippedX(true)
pCorner4:setFlippedY(true)
pSprite:addChild(pCorner4)
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")
pEdge2:setScaleX(nWidth)
pEdge2:setPosition(cc.p(nX + (pCorner:getContentSize().width / 2) + (nWidth / 2), -nY))
pEdge2:setFlipY(true)
pEdge2:setFlippedY(true)
pSprite:addChild(pEdge2)
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:setPosition(cc.p(Winsize.width/2, Winsize.height/2))
layerColor:setAnchorPoint(cc.p(0.5, 0.5))
layerColor:ignoreAnchorPointForPosition(false)
layerColor:setIgnoreAnchorPointForPosition(false)
layer:addChild(layerColor, -1-i)
end
@ -362,7 +362,7 @@ local function BugTest1159()
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:ignoreAnchorPointForPosition(false)
sprite_a:setIgnoreAnchorPointForPosition(false)
sprite_a:setPosition(cc.p(0.0, Winsize.height/2))
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)))
@ -370,7 +370,7 @@ local function BugTest1159()
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:ignoreAnchorPointForPosition(false)
sprite_b:setIgnoreAnchorPointForPosition(false)
sprite_b:setPosition(cc.p(Winsize.width/2, Winsize.height/2))
pLayer:addChild(sprite_b)
@ -620,6 +620,7 @@ local function BugsTestMainLayer()
local i = 1
for i = 1, nTestCount do
local label = cc.Label:createWithTTF(testNames[i], s_arialPath, 24)
print("test label index " .. i)
label:setAnchorPoint(cc.p(0.5, 0.5))
local pMenuItem = cc.MenuItemLabel:create(label)
pMenuItem:registerScriptTapHandler(menuCallback)

View File

@ -311,7 +311,7 @@ local function LayerTest1()
local s = cc.Director:getInstance():getWinSize()
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) )
ret:addChild(layer, 1, kTagLayer)
@ -356,12 +356,12 @@ local function LayerTest2()
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))
layer1:ignoreAnchorPointForPosition(false)
layer1:setIgnoreAnchorPointForPosition(false)
ret:addChild(layer1, 1)
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:ignoreAnchorPointForPosition(false)
layer2:setIgnoreAnchorPointForPosition(false)
ret:addChild(layer2, 1)
local actionTint = cc.TintBy:create(2, -255, -127, 0)
@ -513,7 +513,7 @@ local function LayerIgnoreAnchorPointPos()
local function onToggle(pObject)
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
local ignore = pLayer:isIgnoreAnchorPointForPosition()
pLayer:ignoreAnchorPointForPosition(not ignore)
pLayer:setIgnoreAnchorPointForPosition(not ignore)
end
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
@ -552,7 +552,7 @@ local function LayerIgnoreAnchorPointRot()
local function onToggle(pObject)
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
local ignore = pLayer:isIgnoreAnchorPointForPosition()
pLayer:ignoreAnchorPointForPosition(not ignore)
pLayer:setIgnoreAnchorPointForPosition(not ignore)
end
local item = cc.MenuItemFont:create("Toggle ignore anchor point")
@ -592,7 +592,7 @@ local function LayerIgnoreAnchorPointScale()
local function onToggle(pObject)
local pLayer = ret:getChildByTag(kLayerIgnoreAnchorPoint)
local ignore = pLayer:isIgnoreAnchorPointForPosition()
pLayer:ignoreAnchorPointForPosition(not ignore)
pLayer:setIgnoreAnchorPointForPosition(not ignore)
return ret
end

View File

@ -333,7 +333,7 @@ end
-- sprite:setPosition(cc.p(256, 256))
-- sprite:setOpacity(182)
-- sprite:setFlipY(1)
-- sprite:setFlippedY(1)
-- this:addChild(sprite, 999999)
-- sprite:setColor(cc.c3b::GREEN)

View File

@ -264,8 +264,8 @@ function SpriteFrameTest.onEnter()
local animation = cc.Animation:createWithSpriteFrames(animFrames, 0.3)
SpriteFrameTest.m_pSprite1:runAction( cc.RepeatForever:create( cc.Animate:create(animation) ) )
SpriteFrameTest.m_pSprite1:setFlipX(false)
SpriteFrameTest.m_pSprite1:setFlipY(false)
SpriteFrameTest.m_pSprite1:setFlippedX(false)
SpriteFrameTest.m_pSprite1:setFlippedY(false)
SpriteFrameTest.m_pSprite2 = cc.Sprite:createWithSpriteFrameName("grossini_dance_01.png")
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:setFlipX(false)
SpriteFrameTest.m_pSprite2:setFlipY(false)
SpriteFrameTest.m_pSprite2:setFlippedX(false)
SpriteFrameTest.m_pSprite2:setFlippedY(false)
performWithDelay(Helper.currentLayer,SpriteFrameTest.startIn05Secs, 0.5)
@ -332,10 +332,10 @@ function SpriteFrameTest.flipSprites(dt)
fy = true
end
SpriteFrameTest.m_pSprite1:setFlipX(fx)
SpriteFrameTest.m_pSprite1:setFlipY(fy)
SpriteFrameTest.m_pSprite2:setFlipX(fx)
SpriteFrameTest.m_pSprite2:setFlipY(fy)
SpriteFrameTest.m_pSprite1:setFlippedX(fx)
SpriteFrameTest.m_pSprite1:setFlippedY(fy)
SpriteFrameTest.m_pSprite2:setFlippedX(fx)
SpriteFrameTest.m_pSprite2:setFlippedY(fy)
end