Thanks both for the input.
This is what’s happening:
-
4 sprites are drawn to the screen (z-index works great ), which can be represented as:
[sprite1][z-index=1]
[sprite2][z-index=2]
[sprite3][z-index=3]
[sprite4][z-index=4]

-
Then when other sprites are created, the order becomes as follows and the problem begins:
[sprite5][z-index=5] | [sprite1][z-index=1]
[sprite6][z-index=6] | [sprite2][z-index=2]
[sprite7][z-index=7] | [sprite3][z-index=3]
[sprite8][z-index=8] | [sprite4][z-index=4]

Reinserting the elements to the group works great when there are always a certain number of elements on the screen, but in my case where objects are drawn dynamically it gets a bit tricky and I don’t really have a clue on how to fix this, so any ideas would be kindly appreciated.
Thanks in advance. [import]uid: 8446 topic_id: 3501 reply_id: 10564[/import]