• Content Count

  • Joined

  • Last visited

  1. garry

    antialias only for a container

    Hello, is there a way to have only children of a certain container/sprite with antialias active, not all the renderer?
  2. So I have bunch of sprites (couple of hundreds) with various positions and I need to move every one of the sprites to a same specific location. now I can just update their position one by one but the performance is not the best in this way. but when I put them all in a container and just move the container the performance is much better. but the problem is that each sprite have a various position so they can't get to a same location because well I'm just moving the container. so I was just wondering if there is a way to achieve this with a good performance? any ideas? is there a answer for this question or moving the sprites one by one is just the only way?
  3. garry

    what is the best way to add bunch of images

    what if i just had one image, even then would atlas be helpful? I'm trying to understand if atlas helps only if there are some different images or it's effective even for like 1 image.
  4. Hello, So I need to add like 500 images and this is How I'm doing it: class CreateP extends PIXI.Container { constructor(id, x, y, width, height) { super() = id this.bla = PIXI.Sprite.fromImage(`blabla.png`) //images/textures are not same this.bla.anchor.x = 0.5; this.bla.anchor.y = 0.5; this.bla.x = x this.bla.y = y this.bla.width = width this.bla.height = height this.addChild(this.bla) } } module.exports = CreateP this.blas = new PIXI.Container(); this.stage.addChild(this.blas); . . . this.blas.addChild(new CreateP(id, x, y, width, height)) now it kinda effects on performance pretty a lot, well I know this is a big number but I was wondering if there are some ways to improve the performance? maybe there is a better way to add these images? this doesn't seems normal to me. is this updateTransform and GC normal here? I mean I'm not changing anything about those sprites. they are already added BTW the sprites never move or change or any thing. they just get destroyed after a while. Could RenderTexture help here? I read the docs but honestly couldn't understand what is the purpose of it Thanks
  5. new to pixi here So I needed simple background grid and i did it just by adding lines next to each other like this: for (var i=0; i<40; i++) { var vertical = new PIXI.Graphics() vertical.lineStyle(2, 0x252E35) vertical.moveTo(i * 250 - 5000, -5000) vertical.lineTo(i * 250 - 5000, 5000) vertical.addChild(vertical) } for (var i=0; i<40; i++) { var horizontal = new PIXI.Graphics() horizontal.lineStyle(2, 0x252E35) horizontal.moveTo(-5000, i * 250 - 5000) horizontal.lineTo(5000, i * 250 - 5000) horizontal.addChild(horizontal) } But it effects on performance pretty a lot for just a grid. so I was wondering if there is a better way, an efficient way to do this? Thanks