garry

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. garry

    performance issue, sprites with jumpy movement

    uhhh why didn't I think of that... thanks I'll just do that btw moving them to somewhere out of view would be a more efficient way or just making them invisible?
  2. garry

    performance issue, sprites with jumpy movement

    yea I thought about making a pool but there is a problem: when i said that all the sprites have a same image that was not entirely true, I tried all the sprites with 1 images and the problem was not coming from that so that is why i just said they use 1 same image. there are about 100 images for sprites and at a time there might be up to 2000 sprites with a same image (although the max sprite count is not higher than 2k) so for making a pool i should put 200k sprites invisible somewhere? or is there a way to like have 1 sprite from each image and just copy that? something like that?
  3. garry

    performance issue, sprites with jumpy movement

    turns out this jumpy movement happens when some other sprites get destroyed (sprites get destroyed after couple of seconds). i destroy them like this: container.removeChild(theChild) what can i do here to solve this issue?
  4. I have a performance issue (using pixi 4.8.2 , i've also tried other versions) I creat some sprites *fromImage* and moving them toward an angle simply like this: sprite.x += 1 * Math.cos(sprite.rotation - 90 * (Math.PI / 180)); sprite.y += 1 * Math.sin(sprite.rotation - 90 * (Math.PI / 180)); they all have a same 1kb image, when the sprites count goes higher than like 1000 their movement start becoming jumpy (they slow down then suddenly they move faster - no lag) I tried particle container but nothing changed. and btw there is no frame drop, always 60. (don't mind the timer, it's from something else, i disabled it and tested, it had nothing to do with this issue) Any idea what is the problem? (testing this on a core-i3, 4gb ram computer) Thanks
  5. 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?
  6. 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?
  7. 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.
  8. 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() this.id = 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
  9. 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