- Editado
spine-canvas question (preloaded files);
- Editado
In my project, I used the code from the spine-canvas example. There files (atlas, texture, json) are loaded by using the AssetManager command.
assetManager.loadText("res/assets/" + skelName + '/' + skelName + ".json");
assetManager.loadText("res/assets/" + skelName + '/' + skelName + ".atlas");
assetManager.loadTexture("res/assets/" + skelName + '/' + skelName + ".png");
What should I do if these files are already uploaded to the client earlier? How to handle files already downloaded to the client by JSZIP library , instead of a link to the server?
I assume you mean the web browser has already downloaded them? I would expect the browser to not download them again, but to use the cached files, same as if you had an image on your web site twice.
Nate escreveuI assume you mean the web browser has already downloaded them? I would expect the browser to not download them again, but to use the cached files, same as if you had an image on your web site twice.
I use jszip libary to load files to client by zip-archive, including files exported from the spine. My question is how to handle files with assetManager already downloaded to the client, instead of a link to the server.
You can create your own AssetManager implementation. We have a TypeScript base class (spine-runtimes/AssetManager.ts at 3.6) which you can extend and override methods on. E.g. the canvas backend just passes a function for loading a texture (spine-runtimes/AssetManager.ts at 3.6) to the constructor of the base asset manager.