• Content Count

  • Joined

  • Last visited

  1. As of now, I am creating a new HTML image element with the src set to my SVG data, then using PIXI.TextureCache[id].baseTexture.loadSource(imageElement); to update.
  2. That's better, but I wouldn't use Texture.fromCanvas because my SVG data has already been generated elsewhere (by Fabric.js, in this case). Now I'm doing something like this: PIXI.TextureCache[this.id].destroy(); PIXI.TextureCache[this.id] = PIXI.Texture.fromImage('data:image/svg+xml;charset=utf8,'+ this.ass()); but I'm having an issue with fromImage(). I get this error: "The SVG image must have width and height defined (in pixels), canvas API needs them." Where do I give it those width and height dimensions? BTW, I am using Pixi V.4.5.1
  3. Haha, that Medium article bit... so true. So, a lot of this still goes over my head, because I'm relatively new to Pixi.js. Is the stuff loaded through PIXI.loader basically meant to be immutable? Is there a way to delete a resource that was loaded? I'll explain my issue a bit deeper: My webapp lets the user create a drawing, which is saved as an SVG string and then sent to a PIXI application (via PIXI.loader) and displayed as a sprite. When the user draws a new stroke in their drawing, causing the SVG string to be updated, I need the SVG data to be updated on PIXI's end as well. I could feasibly load a new PIXI resource for every edit made to the drawing (as opposed to updating the existing one), but these drawings can be several hundred Kb's in size, so old drawings would need to be disposed of to avoid memory overhead.
  4. I have a set of image textures produced from by loading an SVG dataURL with PIXI.loader. I need a fairly performant way to change the underlying data of these textures. The name of the texture has to remain the same. Any ideas?