Phaser API Documentation

addPack(pack, [packKey])


Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call this method directly, but instead use Loader.pack and supply a path to a JSON file that holds the pack data. However, if you've got the data prepared you can pass it to this method.

You can also provide an optional key. If you do then it will only add the entries from that part of the pack into to the load queue. If not specified it will add all entries it finds. For more details about the pack file format see the LoaderPlugin.pack method.


name type arguments description
pack any

The Pack File data to be parsed and each entry of it to added to the load queue.

packKey string <optional>

An optional key to use from the pack file data.


true if any files were added to the queue, otherwise false.

  • boolean
Since: 3.7.0