In corona the latest object you add to a group will always show on top of the other, but you can use the object:toFront() function to move an object to the front.
https://docs.coronalabs.com/api/type/DisplayObject/toFront.html
题
I want my object(Object A) to be on top of all other objects, all of my objects are inserted to a group, and each second a new object is created and inserted to the group, in the scene which makes Object A(always on top) to be set below in the new object. I can't find anything in the corona docs. thanks in advance
解决方案
In corona the latest object you add to a group will always show on top of the other, but you can use the object:toFront() function to move an object to the front.
https://docs.coronalabs.com/api/type/DisplayObject/toFront.html
其他提示
Basically, You have to create new viewGroup for every single layer.
For example:
local background_group = display.newGroup() --first group will be background one
local close_background_group = display.newGroup() --second group - in front of first.
local foreground_group = display.newGroup() --third - in front of second, etc.
If Your foreground contains only one object - it is going to be always on the top layer.
If You'd provide any code sample You're working with, it would be easier to help You more.
Relevant reference: group programming guide