Jump to content

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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