Zealot 7 Report post Posted June 4, 2020 I've been playing around with pixi-layers for a few days now and I've noticed 2 things: The layer.on("sort", ...) callback is being called continuously (on each tick if I had to guess). Each elements within layers have an updateOrder attribute that's continuously incrementing: Screen Recording 2020-06-04 at 21.38.49.mov All of that lead me to believe that layers are being continuously re-sorted (I may be mistaken), and I was wondering what was the point of doing such thing? Wouldn't be better to listen for an element's zOrder to change? This behavior can be observed on the example files as well. Quote Share this post Link to post Share on other sites
ivan.popelyshev 1074 Report post Posted June 4, 2020 layers are scanning whole tree every frame, and re-sort stuff, any other implmeentation could have big number of bugs Another trick is that in many cases you dont have to use layers sort, they are mostly used to conventionally move elements to other rendering containers. Default pixi-v5 sort is better in that way - but its limited only to one container, you cant sort through tree. I have custom layers version that actually takes care of all those changes, and even removes pixi canonical updateTransform() pass completely. Its too hard to publish it, people wont understand all those small triggers. 1 Zealot reacted to this Quote Share this post Link to post Share on other sites
Zealot 7 Report post Posted June 5, 2020 Thanks a lot for your insight 😁 Quote Share this post Link to post Share on other sites