首页 > 代码库 > 判断对象是否超出屏幕

判断对象是否超出屏幕

不废话上代码:

//超出屏幕移除该对象        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);            }        },

 

判断对象是否超出屏幕