Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Dynamic Loading for 2.0


gavvic
 Share

Recommended Posts

Hello all,

 

I was wondering if anyone has any working examples of how the dynamic loader functions in the new version. I've been trying to load a JSON file that contains paths to my assets and, in reading through that JSON, add those on the assetQueue. Is this possible?

Link to comment
Share on other sites

Hey @Ninjadoodle,

 

How did you manage to dynamically load and access the assets? I was able to load my JSON (not through the dynamic loader), but after going through the JSON to retrieve the image paths and dynamically add them to the loader, I wasn't able to even create the sprites despite the assetQueue being empty (which I assumed meant that the assets were loaded). Similarly, when I tried the same method from the playground environment (same code and all for testing), that didn't work either. 

 

Thanks.

Link to comment
Share on other sites

Hi @gavvic

 

All i'm doing to start the loader is this ...

game.addAsset('atlas1.json');game.addAsset('atlas2.json');var loader = new game.Loader('stage02');loader.start();

This seems to load the assets and go to the next scene.

 

In Panda 1.xx however, I could remove single graphics ... I'm not sure how to remove atlases, or whether it's implemented in 2.0.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...