Skip to content

Commit

Permalink
Updated Asset Pack Format documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed May 29, 2014
1 parent 5a42a41 commit 8b4113c
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions resources/Asset Pack JSON Format/assetPack.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,58 @@
{
// This is the key you use in the call to Phaser.Loader.pack
// It's an Array of Loader types.
// An Asset Pack is a means to control the loading of assets into Phaser via a JSON file.
// Use Phaser.Loader.pack to load your data file.
//
// Note that lots of parameters are optional.
// See the API Documentation to find out which ones as they match the Loader calls exactly.
// The file is split into sections. In this example they are "level1" and "level2".
// Sections are a way for you to control the splitting-up of asset loading, so you don't have
// to load everything at once.
//
// The key you use for the sections is entirely up to you and is passed to the Phaser.Loader.pack call.
//
// Within each section is an Array of objects. Each object corresponds to a single file to be loaded.
// The "type" property controls the type of file.
// Note that lots of the file properties are optional.
// See the Loader API Documentation to find out which ones, as they match the API calls exactly.
//
// Where a file type has a callback, such as "script", the context in which the callback is run
// should be passed to the Phaser.Loader.pack method. See the examples for further details.
"level1": [
{
// Loads an image.
// Loads an Image
"type": "image",
"key": "ball",
"url": "assets/sprites/shinyball.png",
"overwrite": false
},
{
// Loads a Text File
"type": "text",
"key": "readme",
"url": "assets/sprites/readme.txt",
"overwrite": false
},
{
// Loads a JSON File
"type": "json",
"key": "levelData",
"url": "assets/level1.json",
"overwrite": false
},
{
// Loads a JavaScript File with optional callback
"type": "script",
"key": "webfonts",
"url": "http://blah.com/font.js",
"callback": "parseFontLoader"
},
{
// Loads a Binary File with optional callback
"type": "binary",
"key": "data",
"url": "assets/test/wibble.bmp",
"callback": "parseBinary"
},
{
// Loads a Sprite Sheet File
"type": "spritesheet",
"key": "webfonts",
"url": "assets/sprites/mummy.png",
Expand All @@ -47,33 +63,41 @@
"spacing": 0
},
{
// Loads an Audio File
"type": "audio",
"key": "boden",
"urls": ["assets/audio/bodenstaendig_2000_in_rock_4bit.mp3", "assets/audio/bodenstaendig_2000_in_rock_4bit.ogg"],
"autoDecode": true
},
{
// Loads a Tilemap File - in this example a CSV file.
// The format matches Phaser.Tilemap consts.
"type": "tilemap",
"key": "level1",
"url": "assets/tilemaps/level1.csv",
"data": null,
"format": "CSV"
},
{
// Loads a Tilemap File - in this example a Tiled JSON file.
// The format matches Phaser.Tilemap consts.
"type": "tilemap",
"key": "level2",
"url": "assets/tilemaps/level2.json",
"data": null,
"format": "TILED_JSON"
},
{
// Loads a Physics data File - in this example a Lime Corona file.
// The format matches Phaser.Loader consts.
"type": "physics",
"key": "ship",
"url": "assets/tilemaps/ship_physics.json",
"url": "assets/physics/ship_physics.json",
"data": null,
"format": "LIME_CORONA_JSON"
},
{
// Loads a Bitmap Font File.
"type": "bitmapFont",
"key": "ship",
"textureURL": "assets/tilemaps/ship_physics.json",
Expand All @@ -83,27 +107,31 @@
"ySpacing": 0
},
{
// Loads a JSON Array format Texture Atlas.
"type": "atlasJSONArray",
"key": "map",
"textureURL": "assets/sprites/map.png",
"atlasURL": "assets/sprites/map.json",
"atlasData": null
},
{
// Loads a JSON Hash format Texture Atlas.
"type": "atlasJSONHash",
"key": "map",
"textureURL": "assets/sprites/map.png",
"atlasURL": "assets/sprites/map.json",
"atlasData": null
},
{
// Loads a Starling XML format Texture Atlas.
"type": "atlasXML",
"key": "map",
"textureURL": "assets/sprites/map.png",
"atlasURL": "assets/sprites/map.xml",
"atlasData": null
},
{
// Loads a Texture Atlas where you specify the format.
"type": "atlas",
"key": "map",
"textureURL": "assets/sprites/map.png",
Expand Down

0 comments on commit 8b4113c

Please sign in to comment.