不废话上代码:
//超出屏幕移除该对象 offScreenRemove:function(){ var hw = this.w * 0.5, hh = this.h * 0.5; if(this.x < -hw || this.x > this.owner.cvs.offsetWidth + hw || this.y < -hh || this.y > this.owner.cvs.offsetHeight + hh){ this.owner.removeChild(this); } },
时间: 2024-10-14 11:43:08