Search the Community
Showing results for tags 'arraybuffer'.
-
Mambo vipi, fellow devs- I was wondering if anybody here has any experience with Pixi.js's PIXI.gif.AnimatedGIF runtime object, and its fromBuffer() method in particular? I have the following code: let gif = null; const _onError = () => { console.log(`error!`); }; const xhr = new XMLHttpRequest(); xhr.open(`GET`, `img/gifs/wp.gif`); xhr.responseType = `arraybuffer`; xhr.onload = () => { if (xhr.status < 400) { gif = PIXI.gif.AnimatedGIF.fromBuffer(xhr.response); } else { _onError(); }; }; xhr.onerror = _onError.bind(this); xhr.send(); However, when executed, I receive the following error: Now, according to the fromBuffer() documentation, it accepts two arguments- buffer and options. Buffer's type is ArrayBuffer, which is what I thought I was passing, so I am not really sure what is going on or whether I have to do something to xhr.response before I pass it? Any information or help would be much appreciated! Asante sana in advance
-
- pixi.js
- animated gif
-
(and 3 more)
Tagged with:
-
Hi all, BabylonJS is great. I have a question, maybe someone here can help : Is it possible with the current API (BJ2.5 ou 3) to write directly to the ArrayBuffer used to upload data to the video card? In my program, I would like to generate and update a dynamic mesh and I need it to happen as fast as possible (no freezing, eventually might have to be done in a web worker). In fact, quite often actually, I need to update muliple meshes at once within a frame. I'm worried about the overhead of updating a JS array that, I'm guessing, is copied into an ArrayBuffer to feed to webgl. Can I bypass the JS data format? I would like to "lock" the buffer and write to it. Am I overworrying? I think not.