Giedrius

Members
  • Content Count

    14
  • Joined

  • Last visited

  1. I found the problem. The problem is that my loader loads textures and calls the callback function to create sprites long after the scene has loaded. And here I face problems - if I am creating a sprite from the loaded texture - I get an "Uncaught TypeError: Cannot read property 'x' of undefined" (it does not have defaultAnchor property). I've found out that I need to set empty texture first, like this: this.item = new Sprite(Texture.EMPTY); this.addChildAt(this.item, 0); and then, if I try to set the loaded texture: this.item.texture = this.settings.textures.c_fillT_S.texture; It does set the texture, but as a result BatchRenderer elements array has plenty of "null" items and if try to render that thing - I get the following errors: Uncaught TypeError: Cannot read property '0' of null at BatchRenderer.packGeometry (core.es.js:11542) Uncaught TypeError: Cannot read property '_texture' of null at BatchRenderer.flush (core.es.js:11398)
  2. for example we are loding this PNG file in base64: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAACVBMVEUAAAD///////9zeKVjAAAAAnRSTlMAz31IEhkAAAAQSURBVHgBY0AGjExAgokJAAAtAAiPjSHbAAAAAElFTkSuQmCC while debugging I noticed that it goes into prepareUrl method which splits the dataURI into two parts: directory: "image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAACVBMVEUAAAD///////" file: "9zeKVjAAAAAnRSTlMAz31IEhkAAAAQSURBVHgBY0AGjExAgokJAAAtAAiPjSHbAAAAAElFTkSuQmCC" we used Texture.from("data:image/png;base64,..."); before and it worked fine. It's strange, but when pasting this dataUri in pixi playground - it works just fine, so the problem is somewhere in my code!
  3. We are trying to load a series of data-URI images using base64 like this: PIXI.loader .add("c_fillT_S", "data:image/png;base64,iVBORw0...") .add("c_fillT_M", "data:image/png;base64,iVBORw...") .add("c_fillT_L", "data:image/png;base64,iVBORf...") .load(callback) We need to embedd those small images, so I am not considering importing external files at this moment. I did some debugging and saw, that loader tries to extract file name and directory from that data-URI and of course it's not working. The app breaks not on assigning these textures to sprites but on rendering the scene. Am I doing something wrong? Thanks!
  4. Thanks, Ivan, is it true, that childs of particle container can't have their own childs?
  5. Hi all, We are drawing ~10k interactive sprite circles. We are grouping them in separate PIXI.Containers (sectors). Inside those we do another grouping, this time we use particleContainers to speed up with sprites inside. The problem is - when I try to calculate local bounds of sector container which is certainly filled with particle containers and with sprites - it returns width = 1, height = 1. Can it be the case because of particleContainers? Thanks!
  6. Thank you @ivan.popelyshev! We used three different sized SVG's, created textures from base64. and changed them dynamically based on scale. And yes, we are tinting the sprites.
  7. Very similar WebGL renderer question: we have lots of circle graphics, converted to texture and generated lots of sprites from it. When scaled down they still look pixelated compating to canvas renderer. We did set antialias: true, roundPixels: true and are using resolution of 2. It helped a little, but we still need more of antialiasing (see pics). Does anybody have an idea of how to achieve something similar to canvas renderer? Thanks! Canvas: WebGL:
  8. the problem was caused by this line: interaction.autoPreventDefault = false;
  9. chrome, explorer, edge, firefox supports pointer events which handles mouse events and touch events. But safari and firefox for android doesn't support these events, so we need to fallback to mouse events and touch events. I problem I still face is that if I pinch zoom the pixi canvas on browser which supports pointer events - everything works fine, but if I do pinch zooming on safari on iOS or firefox for android - they should use touch events, but the whole page is being zoomed not the canvas element as expected.
  10. chrome, explorer, edge, firefox supports pointer events which handles mouse events and touch events. But safari and firefox for android doesn't support these events, so we need to fallback to mouse events and touch events then. I problem I still face is that if I pinch zoom the pixi canvas on browser which supports pointer events - everything works fine, but if I do pinch zooming on safari on iOS or firefox for android - they should use touch events, but the whole page is being zoomed not the canvas element as expected.
  11. Giedrius

    Touch Zoom

    @Dan335 try using: e.data.originalEvent.targetTouches
  12. I am creating a venue designer where user can create sectors of seats, customize them and duplicate to place on the other side of the venue. It would be convenient and time saving feature. So the sector is a container which holds row containers with seat objects inside. As I understand, one way would be to make a manual copy, creating an new Container and assigning properties of the original Container.
  13. Oh, I see, the assignment operator doesn't create a copy of an object, it only assigns a reference to it. So I need to make a deep copy with Object.create, but it still removes the original container:
  14. Hi all, I am trying to clone an PIXI Container so that it will have no relationship with the original one, except that they both should share the same prototypes - DisplayObject, EventEmitter, Object. But somehow I loose the original Container, see demo: