How to spawn behind not in front.

Hi I am spawning various characters at different times. Right now the newly spawn character spawns in front of the old one that was spawned just before it. What is the way to make it spawn behind?

Thanks [import]uid: 8192 topic_id: 2245 reply_id: 302245[/import]

if all characters are in the same group, insert the new character and then reinsert all the characters that were spawned earlier

you could also place them in different groups. if groupA was created before groupB, then a character in groupA is behind a character in groupB, no matter when the characters were spawned

[import]uid: 6459 topic_id: 2245 reply_id: 6793[/import]

You can also specify the an index for group:insert(); specifying an index of “1” will always put the display object at the bottom of the group’s visual stack.

local group = display.newGroup()  
local img = display.newImage("img1.png")   
group:insert(img)  
local img2 = display.newImage("img2.png")   
group:insert(1, img2) -- inserts img2 at the bottom of the stack  
-- group:insert(img2) -- insert img2 at the top of the stack  

Tim [import]uid: 8196 topic_id: 2245 reply_id: 6801[/import]

Thanks so much. I ended up using ts_ansca method. Super easy and works like a charm. [import]uid: 8192 topic_id: 2245 reply_id: 6806[/import]

i would do the same thing amigoni!

Tim, thank you so much for making me go back to the manual!
[import]uid: 6459 topic_id: 2245 reply_id: 6823[/import]