Jump to content

ParticleContainer with viewport


SebastianMtl
 Share

Recommended Posts

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

            },

 

Link to comment
Share on other sites

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 by ivan.popelyshev
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...