I’m having a strange issue and I can’t find where exactly is the problem/bug.
When I use load.setPath() in combination with load.multiatlas() I can’t use load.setPath() again AFTER the call to multiatlas. That last call to setPath seems to override the previous values meant for the multiatlases.
For example, I have this in my PreloaderScene:
this.load.setPath('assets/entities');
this.load.atlas('Player_Atlas');
this.load.setPath('assets/common/');
this.load.atlas('ElementsAtlas');
this.load.setPath('assets/level1/');
this.load.multiatlas('Level1_Atlas', 'Level1_Atlas.json');
this.load.multiatlas('Level1_BG_Atlas', 'Level1_BG_Atlas.json');
// THIS LAST CALL TO setPath() messes up
// the previous multiatlas paths
this.load.setPath('assets/level2/');
this.load.atlas('Level2_BG_Atlas');
Now, the LoadManager attempts to load
assets/level2/Level1_Atlas-0.png assets/level2/Level1_Atlas-1.png assets/level2/Level1_BG_Atlas-0.png
instead of
assets/level1/Level1_Atlas-0.png assets/level1/Level1_Atlas-1.png assets/level1/Level1_BG_Atlas-0.png
The atlas and mutialtas json files load properly, it’s the atlas texture’s paths that gets corrupted.
Any ideas where should I look to try a workaround?
PS: Multi atlases files were generated by latest version of TexturePacker.