cseibert 3 Report post Posted August 15, 2018 Is it possible to set a z-index or depth on images or sprites? I have an issue where I am dynamically generating sprites and they are overlaying on top of other things I don't want them to. Using sendToBack or bringToTop isn't an option due to I still need stuff as background and always on top. Right now i'm calling sendToBack and bringToTop on my background and foreground objects every time I create my new sprites. It would be nice if I could just do this.background.zIndex = 0, this.scoreText.zIndex = 100, and make everything else zIndex of like 50. Quote Share this post Link to post Share on other sites
Antriel 73 Report post Posted August 15, 2018 `setDepth(depth)` (or `depth = ...`) can't be simpler, if you just searched for either z index or depth you would find it immediately http://labs.phaser.io/edit.html?src=src/depth sorting/Depth Sorting.js http://labs.phaser.io/edit.html?src=src/depth sorting/z index.js Quote Share this post Link to post Share on other sites
cseibert 3 Report post Posted August 15, 2018 thanks! Quote Share this post Link to post Share on other sites