cocosjs画矩形

test:function(){

varballoonPurpleObj =this.balloonPurple.getBoundingBox();

//var tonguePlateObj = this.tonguePlate.getBoundingBox();

vardrawNode =newcc.DrawNode();

drawNode.clear();//清除节点缓存

drawNode.ctor();//构造函数

drawNode.drawRect(cc.p(balloonPurpleObj.x,balloonPurpleObj.y),cc.p(balloonPurpleObj.x+balloonPurpleObj.width,balloonPurpleObj.y+balloonPurpleObj.height),cc.color(180,180,180));

drawNode.setZOrder(100);

this.addChild(drawNode);//加入Layer层

},

你可能感兴趣的:(cocosjs画矩形)