Jump to content

load labeled array of resources


bbyford
 Share

Recommended Posts

Hi!

I'm trying to load an array of resources from a json file, currently I'm having to include the path and file name when calling the resource, but would love to simply use a label like you can when you make a single file load.

What I have

PIXI.Loader.shared.add(data_json.arrayOfItemsToLoad)...

// When I need to use a file
let audio = PIXI.Loader.shared.resources["../folder1/folder2/folder3/someAudio.mp3"].sound;

What i'd love it to be more like is this:

// what I'd love to do is simply supply the label
let audio = PIXI.Loader.shared.resources["someAudioLabel"].sound;

// what I'd love to do is simply supply the label
let audio = PIXI.Loader.shared.resources["someAudioLabel"].sound;

So What structure do i need to pass to the loader to achieve this with a big list of resources?

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...