cocos2d cc.orbitCamera 用于翻牌动画

// 翻转动画 翻牌
// sBack牌背
// sFront牌面
ccs.runFlipAnim = function (sBack, sFront, duration, cb) {
        sBack.setPosition(sFront.getPosition())
        sFront.getParent().addChild(sBack, sFront.getLocalZOrder() + 1)

        sBack.show()
        sFront.hide()

        sBack.runAction(cc.sequence(
            cc.show(),
            cc.orbitCamera(duration / 2, 1, 0, 0, -90, 0, 0),
            cc.hide(),
            cc.callFunc(function () {
                sFront.runAction(cc.sequence(
                    cc.show(),
                    cc.orbitCamera(duration / 2, 1, 0, 90, -90, 0, 0),
                    cc.callFunc(function () {
                        cb && cb()
                    })
                ))
            })
        ))
    }

猜你喜欢

转载自blog.csdn.net/W_han__/article/details/88059704