ivan.popelyshev

Members
  • Content Count

    3370
  • Joined

  • Last visited

  • Days Won

    71

Everything posted by ivan.popelyshev

  1. Nope, haven't see one. Even more, good OOP i saw only in big closed projects. I'm working on good big example for pixi-v5 that has everything, including physics libs integrations, but its a real work, not hello-world - it takes time, and I have like 10 plugins for pixi to work on You can fund creation of tutorials and quality boilerplates here: https://opencollective.com/pixijs I'm sure we'll have bounties for that.
  2. Most things are done without modification of pixi lib, but you need to look in the sources anyway. For this case, you can just change the method in prototype of class or method in instance. Like "GraphicsGeometry.prototype.addUvs = function () ..." or "myGraphics.geometry.addUVs = ..."
  3. I think I saw someone who used matter with pixijs. ITs the same as with other physics engines. Whats your problem with integrating physics? Here's the lib that helps with PhysicsEditor output: https://github.com/eXponenta/pixi-poly
  4. in Friday night - yes, of course Nope, I suggest you port something from mapbox. There's already use one part of mapbox in pixijs - earcut triangulator.
  5. There's a way to hack vertices in 5.1.1 . Unfortunately, someone erased my playground that shows it (pixi-playground can be edited by anyone) You can hack inside "graphics.geometry.graphicsData" , change shape points and lineStyle/fillStyle. You have to call "graphics.gepmetry.invalidate()" afterwards. As for cloning - it doesn't copy geometry, it just links to the same. You can have several graphics with different transforms but geometry is the same. It was discussed here, but examples are wrong, someone overrode them by mistake:
  6. I believe you need a PIXI.SimplePlane but with custom shader. https://pixijs.io/examples/#/mesh/triangle-textured.js Cant show Plane example, but here's what I had in v4 with CUSTOM mesh, I didnt port it to v5 yet: https://gameofbombs.github.io/examples-heaven/#/mesh/plane.js I need to move it anyway, so maybe next week For now you can try v5 SimplePlane + custom MeshMaterial: just re-assign "shader" or "material" property, its the same.
  7. Its ot unnecessary, your code will work on more devices. > Don't worry about missing my issue, I'm sure I'll manage to wear you down with a million other questions in the next few months. Bring it on! I like tricky things.
  8. That thing with linear floats is not obvious, in pixijs community only you and I stumbled across it My PR was merged mid-June https://github.com/pixijs/pixi.js/pull/5770 . I'll make sure to tell about linear-float stuff to people who will use floats.
  9. I completely forgot about your issue. again. Yes, enabling "baseTex.scaleMode = PIXI.SCALE_MODES.LINEAR" only makes things worse in 5.0.4. However, it works in 5.1.1 because we automaticaly enable FLOAT_LINEAR extension, lines 172 and 183 of https://github.com/pixijs/pixi.js/blob/dev/packages/core/src/context/ContextSystem.js#L183 It doesn't work on all devices, you can see where's it actually available at webglstats.com . Its different extensions for webgl1 and webgl2. Your solution will work everywhere. Congratulations with the achievement!
  10. > But then this happens Thank you for detailed feedback! Very informative first post! Welcome to the forums! >65536 vertices, and we try it in one batch, uint16 indices fail. I think we'll fix Graphics later, but for now there's workaround: https://github.com/pixijs/pixi.js/issues/5973
  11. Here's repo that uses pure canvas2d, no pixi: https://github.com/ivanpopelyshev/bombermine-shuffle , but you can get some pointers from it. Btw, art is free. Graphics or pixi-tilemap is good for "clear, then fill with stuff, clear again, fill again"
  12. yep. im not sure about blocks, you can use Graphics.beginTextureFill or pixi-tilemap instead of sprites, because there are really many blocks.
  13. Yo! Fellow bomber! (look at my avatar) Do it the way it makes sense based on features of the pixi scene tree. Structure of container tree exists to 1. add/remove elements at the same time as their parent. If you remove a bomb - you also remove its shadow, shadow should be its child. 2. transform with parents. If you adjust bomb coordinates - shadow also has to move. If you change camera container coordinates (pivot) - UI cant move, so UI cant be inside camera. 3. all elements are rendered in natural tree-walk order. Filter/masks create extra framebuffer, like, subspace, to deal with elements inside the container. There can be problems with that. pixi-layers gives more freedom with that: 1. you can mark all shadows that way they are rendered BEFORE all bombs, no relation to container tree order - when special shadowLayer is rendered. 2. AS AN OPTION (NOT BY DEFAULT), layer can be rendered in renderTexture and that texture can be put in sprite/filter/whatever. That gives some lighting effects. https://pixijs.io/examples/#/plugin-layers/lighting.js 3. Cache. Unfortunately, there's no invalidation whether something inside layer texture was changed, so you have to do it on your own and add a flag whether renderTexture should be recalcalated
  14. filter breaks antialiasing. you can try to apply "filter.resolution=2" or 3, it will use bigger buffer to draw graphics inside before it applies filter.
  15. I'm sorry, but there were too many basic questions about reels, we are very tired and dont answer them anymore. We have special demo for slots: https://pixijs.io/examples/#/demos-advanced/slots.js Ask questions after you study it
  16. I like it when people first spend some time debugging and then report at forum. Its much easier to work with them. Also, switch off "antialias:true" if you use it. Its trashing performance on slow devices. > Resources -> Buffers -> Buffer2, the Buffer is an array with 24,000 elements that's fine, its our usual multitexturing buffer. > Resources -> Textures, there are 205 textures. Do you use spritesheets?
  17. Welcome to the forums! Good report! If only you read other threads about tilemaps 1. You need spritesheets, not single frames. Put it with TexturePacker or use . This subforum contains many threads about this. Main tutorial https://github.com/kittykatattack/learningPixi explains it too. 2. You can organize your map into chunks, every chunk is PIXI.Graphics with lots of beginTextureFill's. That way you'll save time on refilling dynamic buffer each frame 3. https://github.com/pixijs/pixi-tilemap/ is more suited for tiles than Graphics. 4. Culling: if your map is 400x400 tiles you really dont need all of them fitting in buffer each frame. In "lesson1_5" of non-finished project https://github.com/ivanpopelyshev/pixi-starfighter there is tilemap implementation that uses graphics , but you can use same technique for sprites. Basically, refill the tilemap each time camera touches side of "calculated" screen. Maybe you need only 1. . If its not enough, try 2,3 and 4
  18. Welcome to the forums! Also, this plugin might be related: https://github.com/davidfig/pixi-viewport
  19. Things that you have to study (look in docs, source code): 1. Renderer.resize and its super. 2. container.position, container.scale, container.pivot. If you want to do something in center of screen. position = center, pivot=local coords of that center. Go figure out how those two work. 3. CSS resize. "canvas.width" and "canvas.style.width" are different things. you can scale canvas instead and get a result. Also margin-left margin-top and other CSS things. Algorithm that is suited for your game is born from those three things. Unfortunately, only a few people made that and reported back their findings, and I cant solve every person issues because, actually, its different for everyone If you solve your case , please make an article or at least small post here, maybe we'll get to more general case based on everything people report Someone's medium article: https://medium.com/@michelfariarj/scale-a-pixi-js-game-to-fit-the-screen-1a32f8730e9c More of those threads:
  20. Welcome to the forums! Yes, its a thing. new PIXI.Texture(baseTexture, new PIXI.Rectangle(100, 100, 20, 20)); you can even rotate the frame: https://pixijs.io/examples/#/textures/texture-rotate.js
  21. I meant that i dont see problems with your code.