hello,
it _seems_ that the order that you add objects into display groups is the order in which they are drawn to screen… but there isn’t any way of controlling their position in the drawing order other than with toFront or toBack…
so can you table sort a display group to change the compositing order?
for example create 3 imageRects and assign them an arbitrary property to sort with - say ‘z’
if i then change the ‘z’ value can i re-sort the display group and have it affect the compositing order?
something like:
[lua]
local function compare( a, b )
return a.z < b.z
end
local group=display.newGroup()
local p1 = display.newImageRect(group,…)
p1.z=5
local p2 = display.newImageRect(group,…)
p2.z=15
local p2 = display.newImageRect(group,…)
p2.z=25
table.sort( group , compare )
[/lua]
cheers
andy