createjssprite-sheetpreloadjs

PreloadJS getResult(spriteSheet)


I am trying to acomplish to use the spriteSheetLoader and afterwards get the result with queue.getResult.

It works for images, sounds,... just not my spritesheet objects. Anyone has an idea how I can fetch my preloaded spritesheets?

Part of the code atm

preloadManifest = [
                {src: "/assets/default.json", id: 'spriteShizzle', type:'spritesheet'},
                {src: "/assets/default.png", id: 'thingie'},
            ];

This gets loaded in, but when I cast

preloadQueue.getResult("spriteShizzle");

this will return "undefined" while

preloadQueue.getResult("thingie");

will return my image.

Any way to load the spritesheet wherever I want (so not with the event of a fileload and a switch case like in the examples of CreateJS)?


Solution

  • Ok, I feel bad for doing this, surely after only ten minutes I've found my answer.

    My JSON manifest was wrongly structured. This caused to fail the loading. Check your spritesheet manifest that it is correct!