1. 程式人生 > >cocos creator 撲克牌翻轉效果

cocos creator 撲克牌翻轉效果

   var pic1 =  cc.find("Canvas/puke/hu");
        var run =  cc.callFunc(function()
        {
            cc.loader.loadRes("longhu/card", cc.SpriteAtlas, function (err, atlas) {
                            let frame = atlas.getSpriteFrame('card_player'+10);
                            pic1.getComponent(cc.Sprite).spriteFrame = frame;

                        });
    },this)
    //pic1.runAction(cc.sequence(actionBy1 , run, actionByBack ) );
    pic1.runAction(cc.sequence(cc.rotateBy(0,0,-180),cc.rotateBy(0.5,0,90), run,
    cc.rotateBy(0.5,0,90)) );