Jump to content

v3 - ParticleContainer inside a Container?


Oyed
 Share

Recommended Posts

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!

Link to comment
Share on other sites

  • 3 months later...

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.).

Link to comment
Share on other sites

  • 1 year later...
  • 3 years later...
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

Link to comment
Share on other sites

  • 1 year later...

 

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 by why_m
update
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...