//创建游戏遮罩
this.clip=new cc.ClippingNode();
this.clip.setInverted(true);
this.clip.setAlphaThreshold(0.0);
this.addChild(this.clip,this.kTagClipNode );
var back=new cc.LayerColor(cc.color(0,200,0));
this.clip.addChild(back);
var nodef=new cc.Node();
var close=new cc.Sprite(res.CloseNormal_png);
nodef.addChild(close);
nodef.setPosition(cc.p(size.width/2,size.height/2));
this.clip.setStencil(nodef);
this.tip = new cc.Sprite(res.tip_png);
this.tip.setScale(0.5);
this.tip.setRotation(60);
this.tip.setPosition(cc.p(size.width/2-70,size.height/2+50));
this.addChild( this.tip,this.kTagTip);
this.tip.runAction(cc.repeatForever( cc.sequence( cc.scaleBy(0.25,0.95),cc.scaleTo(0.25,0.5) ) ));
//触摸开始 onTouchBegan:function (touch,event) { var _size =cc.director.getWinSize(); var point=touch.getLocation(); var rect=cc.rect(_size.width/2-30,_size.height/2-30,60,60); if (cc.rectContainsPoint(rect,point)) { //this.removeChild(this.tip,true); var asd = cc.director.getRunningScene().getChildByTag(1000); asd.removeChild(asd.tip); asd.removeChild(asd.clip); return true; } return false; },
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。