charlie_says

Members
  • Content Count

    296
  • Joined

  • Last visited

  • Days Won

    5

charlie_says last won the day on November 13 2020

charlie_says had the most liked content!

About charlie_says

  • Rank
    Advanced Member
  • Birthday 12/12/1972

Contact Methods

  • Website URL
    http://playsnicely.co.uk
  • Twitter
    playsnicely

Profile Information

  • Gender
    Male
  • Location
    Southampton

Recent Profile Visitors

2909 profile views
  1. Thanks @rich_earth I'll take a look at that, although, in the end I took a slightly different direction (I implemented a version of Potrace which I then use to trace the Bitmap and export the SVG shape.)
  2. Updated the project to particle container, large test works at 30fps smaller one works at 60fps - both perfectly acceptable for what I'm doing. Thanks!
  3. I thought about this a little, and realised there were some set up issues (mainly that my sprite was in a container for historic reasons) once I started working with the sprite directly I was able to achieve about a 3x performance improvement on both tests. My project isn't performance driven, so, if it works at 15fps it's ok, it just makes the controls a little unresponsive, but anything lower and they're not really useable. I still don't really understand why when I'm only updating 100 of the sprites I get such different speeds between the 2 tests. Any performance tips would still be gratefully received!
  4. I've got a really odd problem with performance, which is not something I've had with PIXI before... And it appears to be to do with rendering. What I have is 15000 sprites, which are initially pixel sized, from that100 of these are updated every frame (so that could be size, position, tint), doing this gets me about 7fps. If I do a smaller test say 2000 sprites I'll get 30fps, but I'm still only updating 100 of them per frame - so, it seems to me to be the renderer (also, just creating the image, and not doing anything on the update performs the same way.) So, the question is: what can I do to boost the performance here - I've seen plenty of pixi tests like bunnymark, which perform loads better and all those sprites move every frame. It did seem that I could perhaps use a particle container which might help. I could perhaps break the image up into sections then specifically render the sections in turns. But, I'm keen to hear of any other ideas I could work with.
  5. I've been working on some bezier controllers for my current project, and it is a bit of a minefield. The problem is you can get the x & y values from the value f (f is in the range 0,1) which represents how far it is along the curve, but, what is difficult and/or impossible depending on the complexity of your bezier is how to calculate the y value from the x. My curves are simple so I just did a brute force solution, but, for complex beziers there's more than one solution for a given x value.
  6. As per my other topic about loading blob data - I wasn't able to get this to wotk. In the end I loaded the SVG with a fetch which lets me keep my data and create the texture for a sprite.
  7. Despite a bit of experimenting I couldn't get this to work. In the end my solution was to not use the PIXI loader, and just use a fetch() to get my SVG - I can then keep the original data and create a texture from it.
  8. Thanks @ivan.popelyshev I'd actually gone with this this._texture.on('update', () => { if (this._texture.valid) { this.contOpen()} }); which I think is more or less the same as yours. The only thing to note is that with mine this.contOpen() gets called twice. I'm going to try your Promise example in the morning.
  9. Actually, I made a little progress on this, with setting the xhrType property on the loader object - but, it still converts the SVG to an image... so it's not really imported just as data,.
  10. Apologies this question feels a little basic: I'm creating a Texture from data, which works fine - but there's a delay in the texture being ready. I've worked around this for now by using a timeout, Is there a way to use Promises to capture this (I've looked at some examples but it wasn't clear how.) Thanks, Charlie
  11. Further from my query about working with SVG, I'd like to load the image just as data, then I can work around this - whilst I can do this by renaming myFile.svg to myFile.txt it would suite me better to use the original file. I thought you could specify an XHR type in the loader, but this doesn't seem to work for me now (I'm sure I've used it in the past.) Is there a way to load a file as data or a blob?
  12. I had a quick look, and didn't see anything that would allow loading from text - can you point me to a line? I did find: (this as any).svg = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`; which would seem likely to overwrite any path data...
  13. Thanks Ivan - I will investigate further. I'm not actually looking to implement anything with the SVGs, I just need to copy the path data for reuse elsewhere.