Jump to content
Search Community

pixi ParticleContainer

benoit test
Moderator Tag

Recommended Posts

1 hour ago, benoit said:

Really easy to use PixiJS with TL, but do you know if I can use ParticleContainer with more image (png/svg/…) or I just need to create another ParticleContainer ?

 

If you need more than 1 image, you would need to use a sprite sheet so there is only 1 baseTexture.

 

22 minutes ago, PointC said:

If you're asking why your sprites aren't showing, you have a cross-origin problem.

 

 

Sometimes codepen sends the wrong headers. Just need to clear the cache by adding something like ?v=1 to the end of the image url.

 

  • Like 5
Link to comment
Share on other sites

Hi,

 

No cross-origin problem (screenshot).
 

for(let i = 0;i<50;i++){
  let man = new PIXI.Sprite(texture[1]); // bubble
  man.anchor.set(0.5, 0.5);
  sprites.addChild(man);
}
// problem
for(let i = 0;i<50;i++){
  let sman = new PIXI.Sprite(texture[0]); // gsap man #fail
  sman.anchor.set(0.5, 0.5);
  sprites.addChild(sman);
}


See the Pen ZEQLGzg by benoitwimart (@benoitwimart) on CodePen

Capture d’écran 2020-06-18 à 18.31.03.png

Link to comment
Share on other sites

1 minute ago, OSUblake said:

Sometimes codepen sends the wrong headers. Just need to clear the cache by adding something like ?v=1 to the end of the image url.

 

ahh... good to know. I just had that happen the other day with that little dog image I use in all my Pixi tests. I made a duplicate in the asset panel and that seemed to work fine. I'll use the ?v=1 trick next time. Thanks.

  • Like 1
Link to comment
Share on other sites

Just now, PointC said:

ahh... good to know. I just had that happen the other day with that little dog image I use in all my Pixi tests.

 

Yeah, I think that problem only happens when you view the asset and then try to use it with canvas. It will be cached with the wrong headers.

 

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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