Hello,
I'm using pixi 5 with pixi-spine trying to load resources from a cache implemented with indexeddb. All cached files are loaded into patch.files as either blob or text with matching xhrType.
let loader = PIXI.Loader.shared.pre((res, next) => {
// load files that has been loaded by the patcher.
if (patch.files[res.url]) {
res.xhr = patch.files[res.url].xhr;
res.data = patch.files[res.url].data;
res.xhrType = this._xhrType(res.url);
res.complete();
} else {
// not loaded by patcher, load on demand using xhr.
if (!res.url.startsWith(application.realm.resources)) {
res.url = application.realm.resources + res.url;
}
}
next();
});
// loader.add("resource.json");
// loader.begin(...);
Haven't found any good documentation on using the pre function, my problem here is that I get a hit on the "resource.json" in the cache, but "resource.atlas" and "resource.png" is never requested.
This means I cannot access either the .atlas or .png resource using PIXI.Loader.shared.resources using this method https://github.com/pixijs/pixi-spine/blob/master/examples/preloaded_json.md
This works fine when "resource.json" is NOT in the cache and there are no problems loading plain images like "clouds.png".
Please help me, been struggling for a few days 🙈