Container for sprites with z-order

Hi there!

Help me to find a way to store sprites into container, that can be positioned (set x/y coordinates).
That container must have z-order for items sprites (not queue order, but z-order).
Phaser.GameObjects.Container is’t fit for that requirements.

What do you mean by z-order?

Hi @knighter
May be the container method setDepth() is what are you looking for.

I mean the depth property of the sprite. It’s don’t work on contained sprites in Phaser.GameObjects.Container.
The problem was solved by setting depth property and sorting container items list by custom sorting function.

1 Like