SebastianMtl Posted May 29, 2020 Share Posted May 29, 2020 Hi, I have this code who lag when I drag it for navigate in the map. Same for zooming with the mouse wheel. What's the best way to avoid it ? https://codesandbox.io/s/sad-firefly-hgjnu Thanks Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 29, 2020 Share Posted May 29, 2020 (edited) Did you try to profile it with devtools? Look at which functions consume the most time. I think its because its re-calculating bounds of all those graphics objects on screen. Btw why are you using graphics for tiles? You can try Sprites with PIXI.Texture.WHITE and "sprite.tint" that you want, it'll be faster for interaction in your case, but still very heavy because interaction will iterate and check every item. There's no quadtree in pixi, so its your job to provide InteractionManager with better search algorithm Edited May 29, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
SebastianMtl Posted May 29, 2020 Author Share Posted May 29, 2020 (edited) How can I do if I using Particle Container to make each sprite interactive ? Because it doesn't work now Edit: I read this : Quote Particles Container is specifically container for indentical elements, without interaction, alpha blending, tinting, scaling, anchors, position changing by default. But How can display 250000 sprite and make it interactive at same time ? Edited May 29, 2020 by SebastianMtl 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.