Better Dynamic Depth Adjusting

Currently if you want to change the depth of a display object (as in which object gets drawn on top of another) you have to arrange the groups in the order you want them to be displayed. However there are only 2 options of doing this: Send to front and send to back. This makes it extremely difficult to dynamically change the depth of your object.

For instance, consider an RPG where the character’s Y position determines its depth. If you walk in front of an object the character is on top, if you walk behind it the character is drawn behind the object. Doing this type of dynamic depth adjustment is extremely difficult with the current API. I would really like a better way to adjust the order in which objects are drawn so that I can do it at runtime without much processing. [import]uid: 103412 topic_id: 19413 reply_id: 319413[/import]

A good way to implement this would be an optional “z” parameter. You could specify where you wanted to place the object in the z-plane. It would make it super easy to move things to a specific depth location. [import]uid: 51654 topic_id: 19413 reply_id: 75305[/import]

I agree. It wouldn’t even have to be called “z”, it could just be called “depth”. Object.depth, where depth = 0 is default. Anything at depth < 0 (negative) will be drawn below, and depth > 0 will be drawn above, ordered in accordance to depth from greatest to least. [import]uid: 103412 topic_id: 19413 reply_id: 75322[/import]