SebastianMtl Posted June 2, 2020 Share Posted June 2, 2020 Hi ! I try to use particleContainer with viewport but it don't seem to work together . Maybe just a bad code line ? https://codesandbox.io/s/quirky-bird-hjq5o?file=/src/App.vue Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 2, 2020 Share Posted June 2, 2020 (edited) ParticleContainer doesnt work with interaction, its one of limitations. Also it doesnt have bounds. Maybe it affects your app. Edited June 2, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
SebastianMtl Posted June 2, 2020 Author Share Posted June 2, 2020 Ok for interaction, but when I have both ( particle container and viewport ) in the init like this : this.app.stage.addChild(this.container); this.app.stage.addChild(this.viewport); in witch one ,should I put the sprites I display ? drawNewTile(x, y) { const square = new PIXI.Sprite(PIXI.Texture.WHITE); square.x = x; square.y = y; square.width = square.height = 25; square.tint = 0xC1DBE3; // this.viewport.addChild(square); // Or // this.container.addChild(square); }, Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 2, 2020 Share Posted June 2, 2020 Using same number of elements in ParticleContainer and viewport kills all perf optimizations. I'm sorry I dont have time to explain all those things, I can only recommend to read previous threads about tilemap optimizations Quote Link to comment Share on other sites More sharing options...
SebastianMtl Posted June 2, 2020 Author Share Posted June 2, 2020 @ivan.popelyshev it is possible to: 1 -add particle container to app.stage 2- add sprites to viewport 3 - add viewport to particle container ? When I do like that I have a error in console Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 2, 2020 Share Posted June 2, 2020 (edited) ParticleContainer likes only sprites as children, not containers. ParticleContainer should be used when you dont need updateTransform() , interaction and other things and you want to go fast. In this case you want both - that's not for ParticleContainer. Edited June 2, 2020 by ivan.popelyshev 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.