Hi!
I need load some images based on a JSON, I've tried:
init() {
game.load.json('json_key', 'url_to_json.json');
game.load.start();
}
and then:
preload() {
game.cache.getJSON('json_key').imagesName.forEach((name) => {
game.load.image(name, 'url' + name + '.png');
});
}
but it's not working...
the variable game.cache.getJSON('json_key') is null on preload(), but it has the value on create();
I don't wanna use onLoadComplete() because the generic loading bar that I'm using won't calculate the values after the load has completed.
Edit: I know it's possible on create(), but I need it on preload for the loading bar
So that's my question, is there any way to do it?
Thanks;