-
Notifications
You must be signed in to change notification settings - Fork 751
Comments
Added basePath support to SpriteSheetLoader#169
Added basePath support to SpriteSheetLoader #169nki2 wants to merge 1 commit intoCreateJS:master from
Conversation
endel
commented
Oct 14, 2016
Would be quite convenient to have this.
lannymcnie
commented
Oct 14, 2016
Thanks, this is definitely needed. I want to do some testing before accepting the PR, but your work is appreciated.
Our plan is to remove this requirement by getting rid of sub-queues, and instead pushing manifest and SpriteSheetLoader contents into the main queue so that things like maxConnections can be applied to them.
Cheers.
Not super happy with the ambiguity with how this handles basepath on images. Right now the item.path is used for the basepath of the internal manifest instead of the new basepath parameter that is passed in.
Not sure this makes a ton of sense, and it might be better to instead just assume the same basepath for sub-items. Prepending the basepath could result in some weird behavior:
For example if you load "spritesheet.json" with a path of "sprites/" and a basepath of "site/assets/" then you will end up with
sprites/site/assets/image.png
instead of
site/assets/sprites/image.png
Ideally the SpriteSheet format should support a path property for it's assets (instead of the loadItem), and that could be used on individual items or something, and the basepath could be propagated properly. Either way, I am not sold on this approach.
lannymcnie
commented
Feb 4, 2019
This will be considered in PreloadJS 2.0
I have added basePath support to SpriteSheetLoader,
because the current SpriteSheetLoader doesn't take basePath into account when loading spritesheets using SpriteSheetLoader.