Why does this loop kill the performance of a simple Marmalade Quick app?

孤街醉人 提交于 2019-12-08 06:17:30

问题


local board=director:createSprite(0,200);

for y = 0, w*15, w do
  for x = 0, w*15, w do
    local space = director:createRectangle({x=x, y=y, w=w-1, h=w-1, strokeWidth=0, color=color.grey})

    board:addChild(space)
  end
end

In addition to the above, I have some tiles which should be able to be dragged smoothly..

I was astonished at the performance degradation by adding these 225 static objects to the scenegraph... I was hoping for better performance than this. Am I missing something? Is there a different approach I should be trying? Or is Marmalade Quick just not that quick?

来源:https://stackoverflow.com/questions/20184057/why-does-this-loop-kill-the-performance-of-a-simple-marmalade-quick-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!