• Content count

  • Joined

  • Last visited

  • Days Won


ivan.popelyshev last won the day on July 20

ivan.popelyshev had the most liked content!


About ivan.popelyshev

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location
    Moscow, Russia
  • Interests
    Pixi.js, Topcoder, Codeforces, ninjas and bombers

Recent Profile Visitors

2,988 profile views
  1. That's how RAF (requestAnimationFrame) works, you dont have to do anything. Then there's different question: how to calculate something when window is minimized? Add extra setInterval with stuff you need to calculate somewhere,m that checks if last frame was too long ago.
  2. It is used in RpgMaker MV. 1. Its like graphics but for sprites - if you dont clear it, it stays in STATIC buffer, instead of uploading DYNAMIC every frame. 0% of CPU usage when there're no changes. 2. It doesnt create sprite objects - no problem for javascript GC There are stupid restrictions on textures, right now it can work only with 16 base textures of 1024x1024 size. That came from RpgMaker MV, and so far no one complained about it - and I can change it to be more suited for your game. Algorithm of usage: 1. When you fill the tilemap, remember the rectangle area. 2. When user moves camera away from it - refill the tilemap. Tutor: https://github.com/Alan01252/pixi-tilemap-tutorial
  3. I take it that's a continuation of previous thread about level in PNG :)))) Just add some braces and it'll be in a json form.
  4. If you want to dig into something, look at https://github.com/pixijs/pixi-ui
  5. For your game I dont recommend to use DOM it at all, FPS will go down.
  6. You have to use html5 canvas2d api on that. getImageData() and so on. You can also use something like "renderer.extract.xxxxx" i dont remember, look in the docs. I recommend pure html5 api
  7. The other way: http://pixijs.github.io/examples/#/demos/mask-render-texture.js But that one is slower. It creates renderTexture with black color and puts white brush where user clicks. That texture is used as a mask for image to reveal.
  8. Yeah, I know just a hack for it. Hope you understand that im not posting al the code, only the essential parts. Use a renderTexture, then try to clear it with this one: (renderer.state as any).blendModes[20] = [0, WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]; //put a card inside a renderTexture var rt = PIXI.RenderTexture.create(200,200); renderer.render(cardSprite, rt); //add it to stage stage.addChild(new PIXI.Sprite(rt)); //and that's how you can clear a pattern, for example if you have a circle. You can use either Sprite either Graphics, whatever suits you var clearingSprite = new PIXI.Sprite(patternTexture); clearingSprite.position.set(50,50); clearingSprite.blendMOde = 20; renderer.render(cardSprite, rt, false);
  9. Yeah, you are right typescript is easier to understand coming from Java world. I'm using both JDK and Ecmascript: Java6 to Java9/Kotlin/Scala/Groovy, and ActionScript/JS/TS.
  10. It will be better if you use "floor" on x1,y1, "ceil" on x2,y2 and then recalculate height and width. Feel free to look around inside the pixi, and you'll be helping others too :)
  11. When you create the atlas, please add some padding, at least 1 pixel. All the tools (texturePacker, shoebox) can do that.
  12. Yes, you need to make alternative to MeshRenderer: https://github.com/pixijs/pixi.js/tree/dev/src/mesh/webgl, and specify "rope.pluginName='myPlugin'". Example of renderer is here: https://github.com/pixijs/pixi-plugin-example , but it cant work with meshes, sorry you have to copy MeshRenderer. I know its pain, but right now there's no other way. At least in v4. You can try v5-alpha, its much easier: http://dev.goodboydigital.com/client/goodboy/geometry/examples/index.html#/mesh/sharing-geometry.js , build is here: https://pixijs.download/next/pixi.js , branch is here: https://github.com/pixijs/pixi.js/tree/next If you build a shader there, and it works, try to port that shader to v4 using my example.
  13. More ifs for the god of ifs!
  14. According to https://github.com/pixijs/pixi.js/blob/dev/src/extras/cacheAsBitmap.js#L173 its not snapping the coords, and that's part of the problem. If we somehow ensure that localbounds are integers, filtering bug will go away. As for other, i dont know yet I created an issue: https://github.com/pixijs/pixi.js/issues/4170
  15. More if's to if's god! Also, that might help you if you want to use v4-shader instead of v4-filter. Just make a skewed sprite and change "sprite.pluginName = 'myPlugin'", and that'll work.