Closed melanke closed 9 years ago
Actually I think it could be more subtle:
Chunks are always enabled, depends on user to put elements in it:
//lazy will make the element to be put on a chunk
CC.new("Class1 #ElId", { x: 12, y: 13, lazy: true });
and elements that are not sedentary will be placed on a special chunk that is checked everytime
so if you use
CC.areaSearch({ x: 0, y: 10, w: 30, h: 30 });
we search elements inside the right chunk and inside special chunk
CC.clear();
will clear chunks as well
But they will be optional
To use chunks we need to create them
CC will use chunks when available, and has to check if there is chunks
If we don't need to use chunks anymore, we can destroy them all, but the elements will stay in stage
We can get the element list inside the chunks of an area
If the element change it's position, is a good idea to fix it's chunk, it will remove the element from the wrong chunk and put in the right chunk