1
votes

I'm developing a game in Corona SDK!

My game loads rooms individually and then places them side-by-side to make a full map. Each room is its own Display Group made with display.newGroup(). I used the opensource library ponyTiled to do most of this.

There is a minor problem though: All objects placed in the second room are put in FRONT of all the objects in the first one. That includes background, NPCs, Walls, floor tiles, etc. I tried using object:toBack() to move background tiles backwards, BUT since the rooms are separate display groups, they don't effect each other!

SO! I need to know how to combine display groups so I can use object:toBack()! How do I do that?

1

1 Answers

2
votes

You can add display groups inside other display groups. For instance, sceneGroup is just a display group.

If you were to add the display groups that you want to order inside the same display group, like the sceneGroup, then you can use the group:toFront(), group:toBack(), etc. function calls.