cocos翻轉效果
阿新 • • 發佈:2019-01-23
local function AniOverturn() local imgUp = cc.Sprite:create("image/gamesIcon/ddzIcon.png") imgUp:setPosition(640,360) local imgDown= cc.Sprite:create("image/gamesIcon/ddzIcon.png") imgDown:setPosition(640,360) imgDown:setVisible(false)
建立一個動作物件,動作完成時間是2秒,起始半徑為1、半徑差為0、起始z角為0、旋轉z角的差為180、起始x角0、旋轉x角的差0
self:addChild(imgUp,10000) self:addChild(imgDown,10000) imgUp:runAction(cc.Sequence:create(cc.DelayTime:create(5),cc.OrbitCamera:create(0.3, 1, 0, 0, 90, 0, 0), cc.CallFunc:create(function() imgDown:setVisible(true) imgDown:runAction(cc.OrbitCamera:create(0.3, 1, 0, 270, 90, 0, 0)); end))) end AniOverturn()