• Content Count

  • Joined

  • Days Won


Everything posted by Fatalist

  1. It's a matter of when, not if.
  2. I think it can't parse this color, so it ignores it. #F40 = #FF4400, but a 4-letter color can not be parsed, AFAIK.
  3. Scale down your textures, use a texture atlas.
  4. Yes. render() is synchronous, nothing can run after you call it and before it returns. And requestAnimationFrame guarantees the GPU is done drawing as well. For canvas there is a similar trick with getImageData(), but requestAnimationFrame is better anyway. The way I understood, the problem is that he wants to have let's say a 2-second animation, but because initial rendering takes 1 second, he sees a frozen screen for 1 second and then only one second of animation.
  5. That's the default size of a canvas element, you should set its .width and .height to 30.
  6. Nice. Another thing that would be useful(and more straightforward in your case too), is to have an optional boolean parameter in BitmapData.update that tells it to not discard old data and just update the specified rectangle.
  7. Great! Can't wait to see your game getPixel should work too, it's the same data under the hood.
  8. It should be reliable, that's what requestAnimationFrame is for. Another way - use readPixels to force synchronization. Put this after .render() : renderer.gl.readPixels(0, 0, 1, 1, renderer.gl.RGBA, renderer.gl.UNSIGNED_BYTE, new Uint8Array(4)); - on the javascript side, but it can take some time before the GPU actually renders things on the screen.
  9. You don't need to set it, they point to the same data anyway. In fact, you don't need destPixels/sourcePixels at all, just use .pixels property instead. Put this after copyBitmapData to see where do the pixels actually change: this.level.context.putImageData(this.level.imageData, 0, 0);
  10. The pixels array is one-dimensional, so to get to pixel [x, y] you need the element at: y * width + x Have not tested it, but this should work: function copyBitmapData(source, dest, x, y) { var sourcePixels = new Uint32Array(source.data.buffer), destPixels = new Uint32Array(dest.data.buffer); for (var i = 0; i < source.height; i++) { var destRowStart = (y + i) * dest.width + x; for (var j = 0; j < source.width; j++) { var pixel = sourcePixels[i * source.width + j]; destPixels[destRowStart + j] = pixel; } } }
  11. Create a smaller ImageData, update it and the copy its data pixel-by-pixel to the main ImageData.
  12. See this answer: http://stackoverflow.com/questions/6773481/how-to-get-the-mouseevent-coordinates-for-an-element-that-has-css3-transform/7059054#7059054 I think that will give you the correct position and then use this function to find the clicked sprite: http://pixijs.download/release/docs/PIXI.interaction.InteractionManager.html#processInteractive
  13. Try with a canvas renderer, and test some other benchmarks, like PIXI bunnymark.
  14. In some situations. For example, if you use a BitmapData(and change it every frame), or text that you change every frame. Or if you use pre-2.7 Phaser and use a tilemap.
  15. It may be due to a larger screen resolution, make sure you test in a same-size window. Or maybe your computer is better in some way, for example, your CPU may have a better single-core performance.
  16. Well without mipmapping it will be pixelated at lower scales. Actually extrusion does solve it completely as far as I know, do you know a scenario where it does not?
  17. Generally this is often solved by making the corners of the character hitbox a bit curved, so it can naturally slide through doorways and over small obstacles. You can try that if you switch to p2 physics.
  18. So your browser does not support WebGL. See canvas version here: http://www.goodboydigital.com/pixijs/canvas/bunnymark/ "In ParticleContainer, can I remove or add an object very easily? Is it OK the objects are different sizes? " yes.
  19. Are you using blurFilter? That's gonna be expensive. How does fog work in your game, is it tile-based?(like here: https://pixel-cave.com/) That is, every tile is either visible or not(with blurred edges), or is it polygonal, where only half of a tile can be in fog?
  20. ParticleContainer. http://www.goodboydigital.com/pixijs/bunnymark_v3/
  21. Phaser's quad tree is not very efficient. For example, you can't update a single object, you need to clear and repopulate it every time something changes. And sometimes it returns too many objects, see this thread - Understanding Phaser Quadtree So you may have to find some better implementation.
  22. I don't know, my monitor has devicePixelRation of 1 and the devices icon downscaled with pixi looks exactly the same as downscaled with Illustrator. But for your scenario, it does make sense to just use svg.
  23. Yeah that should be working...
  24. I added a one-pixel transparent padding to the devices icon and it looks better - http://imgur.com/a/vztq8 For the lines - Graphics lines are not perfectly antialiased so you can use this class: http://pixi-graph.netlify.com/LineSprite.js .