Questions about setDepth()

Does setDepth actually have a limit?

Can setDepth be used on basically everything? I was trying to use it on a path (I was drawing a line with a path and I wanted it to be drawn behind UI elements)

Are there certain cases where setDepth might not work? Like if I did it on an individual in a group for example, would it ignore the depth of the group itself? I’m using setDepth, and also tried directly setting the z value of some of my objects and it’s not working, however I just want to know more about setDepth in general because maybe I’m missing a bigger idea.

Thanks!

For anything that has a setDepth() method, it should work. Paths and Groups don’t have it but Graphics and Shapes do.

At the end of your create() add

console.log(this.sys.displayList.getChildren());

Everything you see there you should be able to change depth.

1 Like