benoit Posted June 18, 2020 Share Posted June 18, 2020 Hi, 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 ? See the Pen QWydWpK by benoitwimart (@benoitwimart) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 18, 2020 Share Posted June 18, 2020 Hey benoit. I don't understand your question. Can you please try to rephrase it? Maybe make some comments in the code about what you're trying to do? Link to comment Share on other sites More sharing options...
PointC Posted June 18, 2020 Share Posted June 18, 2020 If you're asking why your sprites aren't showing, you have a cross-origin problem. 1 Link to comment Share on other sites More sharing options...
OSUblake Posted June 18, 2020 Share Posted June 18, 2020 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. 5 Link to comment Share on other sites More sharing options...
benoit Posted June 18, 2020 Author Share Posted June 18, 2020 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 Link to comment Share on other sites More sharing options...
PointC Posted June 18, 2020 Share Posted June 18, 2020 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. 1 Link to comment Share on other sites More sharing options...
OSUblake Posted June 18, 2020 Share Posted June 18, 2020 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. 1 1 Link to comment Share on other sites More sharing options...
benoit Posted June 18, 2020 Author Share Posted June 18, 2020 So http://pixijs.download/release/docs/PIXI.Spritesheet.html and… any example ? I don't want to animate my particule. Link to comment Share on other sites More sharing options...
OSUblake Posted June 18, 2020 Share Posted June 18, 2020 I don't have any examples on hand. All I can remember is that you have to set uvs to true on the particle container. http://pixijs.download/release/docs/PIXI.ParticleContainer.html But this question is more about PixiJS. Try searching their forums. I know it's come up before. https://www.html5gamedevs.com/forum/15-pixijs/ 3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now