Hacking the loader :-)

Hi,

has anybody tried to hack the loader? :slight_smile:
I’m trying to have multiple animations on one page. I don’t want to insert wickengine.js multiple times, so I download this manuarlly; no problem, of course.
But then: I would like to be able to load project.wick for the animations in a different way to. Now, the player expexts this as a stream, which contains this .zip-file.

If I wanted to load this with, say, a string, Base64 encoded and feed that to the wick-player, could that be done?

I understand that this is a very specific question, but if I look at the way it is loaded, this whould be possible, I feel :slight_smile:

regards,

Paul

That is big brain

this is too high-tech for me to even understand… wow

correction: this is way too much for my brain to handle :exploding_head:

Got it :slight_smile:

Thanks to the great work of the wick-wizzards (wickards? :innocent:), it was not a hard problem.
If you download a project as a zip-file, you can unzip it. (Duh!)
But then, the fun starts. You will have a large file, basically the wick-application, and a small one, which is called: project.wick. This is also a .zip file, which contains your timeline and all assets. You do NOT need to unzip it. But you can load this in a Base64 encoder.
If you have loaded the wickengine.js before, you can just call wick with your project like this:

strBlob = "*** very long base64 string ***";
Wick.WickFile.fromWickFile(strBlob, project => {
  project.inject(document.getElementById('wick-canvas-container'));
}, 'base64');

This helps me tremendously, as I can now play small animations without loading wick all the time :slight_smile:

If you are not a JS programmer, just delete the space this takes up in your mind. I just did not want anybody spending time while I found it myself.

Paul

1 Like

I researched base64 strings, and it sounds pretty interesting!
Thanks for sharing the code here Paul, I didn’t even know it
was possible!

:slightly_smiling_face:

wow big big brain moment

this is big brain time