cocos creator滚动渲染优化
//滚动优化
RollingOptimization:function (view,list) {
let viewPos = view.parent.convertToWorldSpaceAR(view.getPosition());
let viewBox = cc.rect(viewPos.x-view.width/2,viewPos.y-view.height/2,view.width,view.height);
cc.log(viewBox)
for (let i = 0; i < list.length; i++) {
if (viewBox.intersects(list[i].getBoundingBoxToWorld())) {
list[i].opacity = 255;
cc.log("255",i)
} else {
list[i].opacity = 0;
cc.log("0",i)
}
}
},
本文标题:cocos creator滚动渲染优化
本文链接:https://www.haomeiwen.com/subject/hflmnctx.html
网友评论