I have created an external manifest file which contains a list of all assets to preload. Example:
{
"path":"assets/",
"manifest": [
{"id":"background", "src":"images/game-background.jpg"},
{"id":"ui-elements-json", "src":"images/ui-elements.json"}
]
}
ui-elements-json is a sprite sheet created in TexturePacker containing various UI elements. My problem is that the actual image is NOT loaded until I create the spritesheet with:
var ss = new createjs.SpriteSheet(preload.queue.getResult('ui-elements-json'));
Which means that it's not being preloaded. At least I cannot see it being loaded in my developer panel. I can manually add the image to the Manifest file like so:
{"id":"ui-elements", "src":"assets/images/ui-elements.png"}
But it's almost as if the image then gets loaded twice and I begin getting some performance issues. If I add "type":"spritesheet" in my Manifest I can see that the image now preloads which is great, but when I create the Sprite Sheet I get the following error:
"Uncaught TypeError: Cannot read property 'slice' of undefined"
Here is a simplified version of my sprite sheet json. As far as I can see it's formatted correctly.
{
"images": ["assets/images/ui-elements.png"],
"frames": [
[511, 2, 1378, 46],
[797, 755, 133, 128],
[871, 885, 133, 128],
[564, 132, 133, 128]
],
"animations": {
"ui-Infobar":[0],
"ui-autospin-down":[1],
"ui-autospin-hover":[2],
"ui-autospin":[3]
}
}
I just need to make sure that my sprite sheet image is prealoded.