PhaserEditor2D-v3 icon indicating copy to clipboard operation
PhaserEditor2D-v3 copied to clipboard

Loading a pack in a pack

Open robinheidrich opened this issue 3 years ago • 4 comments

The ability to load another pack in a pack is missing. I have manually edited a pack and added an object with the type pack to test if it works, and it does.

It would be great if it was possible in Phaser Editor.

robinheidrich avatar Jul 11 '22 03:07 robinheidrich

Yes, I think I can implement it.

arianfornaris avatar Jul 11 '22 03:07 arianfornaris

Like the other issue, it would be great if you explain a bit why do you need this feature. I can implement this issue but it is about to understand how the users are using the editor.

arianfornaris avatar Jul 11 '22 03:07 arianfornaris

Sure. It's just that I have a lot of audio files and I want to organize them together with their associated sprites. So it makes the most sense for me to load the audios and the sprite in a separate pack instead of everything in one "preload" pack.

robinheidrich avatar Jul 11 '22 13:07 robinheidrich

Ok, thanks. In the meantime, you can create a separate pack but load it "by hand".

In the preload method you do:

preload() {
  this.load.pack("pack1", "assets/pack1.json");
  this.load.pack("pack2", "assets/pack2.json");
  this.load.pack("pack3", "assets/pack3.json");
}

PhaserEditor2D avatar Jul 25 '22 12:07 PhaserEditor2D