//回调函数动画
callbackAnimation : function() {
var origin = null;
var card = cc.instantiate(this.cardSprite);
card.tag = 1000 + this.count;
card.setPosition(this.bg.width/2,this.bg.height/2);
card.width = 49;
card.height = 60.5;
//加到背景
this.bg.addChild(card);
this.cardArr[this.count] = card;
//添加监听器到管理器
this.addListenerEventTouch(card);
//0.改变牌的postion
if(this.count < 9) {
origin = cc.p(this.bg.width/2 - this.index + this.count * this.cardWidht, this.cardHeight/2);
} else {
origin = cc.p(this.bg.width/2 - this.index + (this.count - this.rowMaxCount) * this.cardWidht, this.cardHeight/2 + this.cardHeight);
}
//1.移动动画
var action = cc.moveTo(this.delay,origin);
//2.压缩动画
var scaleHide = cc.scaleBy(this.delay, 0,1);
//3.回调函数动画
var callAction = cc.callFunc(this.scaleCardSprite, this,card);
//4.创建顺序动画组
var seq = cc.sequence(action,scaleHide,callAction);
//5.执行顺序动画组
card.runAction(seq);
this.count++;
},
//给当前手牌设置纹理
var texture = cc.textureCache.addImage(this.imageName);
this.getComponent(cc.Sprite).spriteFrame.setTexture(texture);
},
// 产生新牌
newCard:function(row){
//修改纹理
this.updateSpriteFrame(row);
//翻转动画
// var scaleShow = cc.scaleTo(this.delay, 1);
// this.node.runAction(scaleShow);
},