cocos2d-js中的扑克牌翻转的效果

来源:互联网 发布:sails.js 与express 编辑:程序博客网 时间:2024/06/05 08:09

在2d游戏场景中,想制作一个扑克牌翻转的立体效果。

首先准备一张正面和反面的牌,生成反面的牌:

this.pokerSpr = new cc.Sprite(res.poker1_png);this.pokerSpr.x = 200;this.pokerSpr.y = 300;this.addChild(this.pokerSpr);

点击界面改变图片:

this.pokerSpr.runAction(cc.sequence(    cc.rotateBy(0.5,0,90),    cc.callFunc(function(target){        this.pokerSpr.setTexture(res.poker1_png);    },this),    cc.rotateBy(0.5,0,90)));

原创粉丝点击