Zealot Posted June 4, 2020 Share 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 Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 4, 2020 Share 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. Zealot 1 Quote Link to comment Share on other sites More sharing options...
Zealot Posted June 5, 2020 Author Share Posted June 5, 2020 Thanks a lot for your insight ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.