Closed andreasmcdermott closed 8 years ago
+1 to this idea,
If you wanna accomplish it outside of the framework you can: Load images as full paths, "some/path/to/image", after all images are loaded, iterate over the images and 'expand' all images into the desired heirarchy using a function like this
I've pushed r8 where "path/to/something" expands into path.to.something
- please test it out
Wow, that was quick. I tested it out and it works well for me. I now have both the 'group/img' and group.img.
I do not want to get rid of "path/to/image" string yet as it would break the compatibility for many users. The caveat is that there are some edge cases like naming the image same as folder but I hope nobody does that. ;)
Would it be possible to add an option for loading assets into a hierarchy instead of the current solution?
Loading: this.loadImages('group/a', 'group/b', 'othergroup/c');
Using the assets currently: this.drawImage(this.images['group/a'], ..);
What I'd prefer: this.drawImage(this.images.group.a, ..);