cocos 간편 지주 카드 애니메이션

2276 단어
niuniuSend : function (int) {
switch(int)
{
case 0:
for(var i=0;i<5;i++){
var sp = new ccui.ImageView("cards/card_a1.png", ccui.Widget.PLIST_TEXTURE);
sp.setPosition(cc.p(cc.winSize.width / 2, cc.winSize.height / 2));
sp.setScale(0.8);
this.addChild(sp);
var bezier = [cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ), cc.p(cc.winSize.width / 2 - 200+(i*80) , cc.winSize.height / 2), cc.p((cc.winSize.width / 2-150) +(i*80), 100)];
sp.runAction(cc.sequence(cc.spawn(cc.delayTime(1+(i/20)),cc.bezierTo(1, bezier))));
}
this.niuniuSend(1);
break;
case 1:
for(var i=0;i<5;i++){
var sp = new ccui.ImageView("cards/card_a1.png", ccui.Widget.PLIST_TEXTURE);
sp.setPosition(cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ));
sp.setScale(0.5);
this.addChild(sp);
var bezier = [cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ), cc.p(cc.winSize.width / 2 + 300 , cc.winSize.height / 2 + 300), cc.p(cc.winSize.width / 2 + 700 -(i*50), cc.winSize.height/2)];
sp.runAction(cc.sequence(cc.spawn(cc.delayTime(1+(i/20)),cc.bezierTo(1,bezier ))));
}
this.niuniuSend(2);
break;
case 2:
for(var i=0;i<5;i++){
var sp = new ccui.ImageView("cards/card_a1.png", ccui.Widget.PLIST_TEXTURE);
sp.setPosition(cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ));
sp.setScale(0.5);
this.addChild(sp);
var bezier = [cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ), cc.p(cc.winSize.width / 2 - 300 , cc.winSize.height / 2 + 300), cc.p(cc.winSize.width / 2 - 700 + (i*50), cc.winSize.height/2)];
sp.runAction(cc.sequence(cc.spawn(cc.delayTime(1+(i/20)),cc.bezierTo(1,bezier ))));
}
break;

default:
break;
}
},

좋은 웹페이지 즐겨찾기