Oyed Posted May 11, 2015 Share Posted May 11, 2015 I want to render my Tiled Map in Chunks, and to do so, I thought of chunking sections of the map in to ParticleContainers and then having the ParticleContainers all inside of a Container to render to the player, switching each ParticleContainers visibility based on what the User can see (To save on performance). Is this possible? I've tried doing it and I get "Uncaught TypeError: Cannot read property 'baseTexture' of undefined". Either way, is this the best way to go about it? Thanks! Quote Link to comment Share on other sites More sharing options...
xerver Posted May 13, 2015 Share Posted May 13, 2015 What you describes sounds fine, nothing wrong with that technique at all. If you think you are experiencing a bug, post an issue on GitHub with a running example of what is breaking: https://github.com/GoodBoyDigital/pixi.js/issues Quote Link to comment Share on other sites More sharing options...
Hachi Posted August 25, 2015 Share Posted August 25, 2015 Well this is a bit old answer, but as I just discovered the same error message, I thought I'd expand this a bit for anyone else who stumbles here. As I understand the ParticleContainer needs to be limited to certain children inside of it and for example I was having a normal Container inside ParticleContainer, which caused an issue naturally.So for example in a game that needs multiple layers of containers, you add normal containers first and you can only add ParticleContainers as the last layer of containers, before the actual graphics (Sprites etc.). Quote Link to comment Share on other sites More sharing options...
xerver Posted August 25, 2015 Share Posted August 25, 2015 Particle containers should only contain sprites, and all those sprites should share a base texture. Quote Link to comment Share on other sites More sharing options...
caymanbruce Posted January 16, 2017 Share Posted January 16, 2017 On 8/26/2015 at 6:37 AM, xerver said: Particle containers should only contain sprites, and all those sprites should share a base texture. When you say "share a base texture", does that mean the size and color need to be the same? Quote Link to comment Share on other sites More sharing options...
xerver Posted January 16, 2017 Share Posted January 16, 2017 It means that there should only be one instance of PIXI.BaseTexture that each of them use. Quote Link to comment Share on other sites More sharing options...
Awli Posted May 4, 2020 Share Posted May 4, 2020 On 8/26/2015 at 12:37 AM, xerver said: Particle containers should only contain sprites, and all those sprites should share a base texture. That sentence would be great to have in the documentation Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 8, 2020 Share Posted May 8, 2020 yep, confirmed , we still miss it: https://github.com/pixijs/pixi.js/blob/dev/packages/particles/src/ParticleContainer.ts#L20 @Awli care to make a PR? Quote Link to comment Share on other sites More sharing options...
why_m Posted August 27, 2021 Share Posted August 27, 2021 (edited) On 8/25/2015 at 11:37 PM, xerver said: Particle containers should only contain sprites, and all those sprites should share a base texture. I currently have a ParticleContainer that it's working with different baseTextures if I have all the textures in different files but if I make a spritesheet out of them and some are in a different spritesheet then it has the expected behaviour (it doesn't work because they have different baseTextures). What I want to know is why in the first example it works (each image is a different texture and texture = baseTexture). EDIT: It was using the same texture after all but it was in different sizes so it seemed like different textures. You can delete this message. Edited August 27, 2021 by why_m update 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.