<ahref="global.html#Phaser.Path#numPointsreturn%257Bnumber%257DThetotalnumberofPathPointsinthisPath.">Phaser.Path#numPoints
return {number} The total number of PathPoints in this Path.</a>
<p>Parallel loading (see <ahref="Phaser.Loader.html#enableParallel">enableParallel</a>) is supported and enabled by default.<br>Load-before behavior of parallel resources is controlled by synchronization points as discussed in withSyncPoint.</p>
<p>Texture Atlases can be created with tools such as <ahref="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a> and<br><ahref="http://renderhjs.net/shoebox/">Shoebox</a></p>
<p>If you want to append a URL before the path of any asset you can set this here.<br>Useful if allowing the asset base url to be configured outside of the game code.<br>The string <em>must</em> end with a "/".</p>
<p>Used to map the application mime-types to to the Accept header in XHR requests.<br>If you don't require these mappings, or they cause problems on your server, then<br>remove them from the headers object and the XHR request will not try to use them.</p>
<p>This object can also be used to set the <code>X-Requested-With</code> header to<br><code>XMLHttpRequest</code> (or any other value you need). To enable this do:</p>
<p>This event is dispatched immediately before a file starts loading.<br>It's possible the file may fail (eg. download error, invalid format) after this event is sent.</p>
<p>This event is dispatched when the loading process starts: before the first file has been requested,<br>but after all the initial packs have been loaded.</p>
<p>Would load the <code>ball</code> file from <code>images/sprites/ball.png</code> and the tree from<br><code>images/sprites/level1/oaktree.png</code> but the file <code>boom</code> would load from the URL<br>given as it's an absolute URL.</p>
<p>A general indicator of the progress.<br>It is possible for the progress to decrease, after <code>onLoadStart</code>, if more files are dynamically added.</p>
<p>Internal function that adds a new entry to the file list. Do not call directly.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>type</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The type of resource to add to the list (image, audio, xml, etc).</p></td>
</tr>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The unique Cache ID key of this resource.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The URL the asset will be loaded from.</p></td>
</tr>
<tr>
<tdclass="name"><code>properties</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
(none)
</td>
<tdclass="description last"><p>Any additional properties needed to load the file. These are added directly to the added file object and overwrite any defaults.</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If true then this will overwrite a file asset of the same type/key. Otherwise it will only add a new asset. If overwrite is true, and the asset is already being loaded (or has been loaded), then it is appended instead.</p></td>
</tr>
<tr>
<tdclass="name"><code>extension</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>If no URL is given the Loader will sometimes auto-generate the URL based on the key, using this as the extension.</p></td>
<p>If using Texture Packer we recommend you enable "Trim sprite names".<br>If your atlas software has an option to "rotate" the resulting frames, you must disable it.</p>
<p>You can choose to either load the data externally, by providing a URL to a json file.<br>Or you can pass in a JSON object or String via the <code>atlasData</code> parameter.<br>If you pass a String the data is automatically run through <code>JSON.parse</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getImage(key)</code>. JSON files are automatically parsed upon load.<br>If you need to control when the JSON is parsed then use <code>Loader.text</code> instead and parse the JSON file as needed.</p>
<p>The URLs can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the textureURL isn't specified then the Loader will take the key and create a filename from that.<br>For example if the key is "player" and textureURL is null then the Loader will set the URL to be "player.png".<br>The same is true for the atlasURL. If atlasURL isn't specified and no atlasData has been provided then the Loader will<br>set the atlasURL to be the key. For example if the key is "player" the atlasURL will be set to "player.json".</p>
<p>If you do not desire this action then provide URLs and / or a data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>Unique asset key of the texture atlas file.</p></td>
</tr>
<tr>
<tdclass="name"><code>textureURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas image file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas data file. If undefined or <code>null</code> and no atlasData is given, the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.json".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasData</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>A JSON or XML data object. You don't need this if the data is being loaded from a URL.</p></td>
</tr>
<tr>
<tdclass="name"><code>format</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>The format of the data. Can be Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY (the default), Phaser.Loader.TEXTURE_ATLAS_JSON_HASH or Phaser.Loader.TEXTURE_ATLAS_XML_STARLING.</p></td>
<p>If using Texture Packer we recommend you enable "Trim sprite names".<br>If your atlas software has an option to "rotate" the resulting frames, you must disable it.</p>
<p>You can choose to either load the data externally, by providing a URL to a json file.<br>Or you can pass in a JSON object or String via the <code>atlasData</code> parameter.<br>If you pass a String the data is automatically run through <code>JSON.parse</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getImage(key)</code>. JSON files are automatically parsed upon load.<br>If you need to control when the JSON is parsed then use <code>Loader.text</code> instead and parse the JSON file as needed.</p>
<p>The URLs can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the textureURL isn't specified then the Loader will take the key and create a filename from that.<br>For example if the key is "player" and textureURL is null then the Loader will set the URL to be "player.png".<br>The same is true for the atlasURL. If atlasURL isn't specified and no atlasData has been provided then the Loader will<br>set the atlasURL to be the key. For example if the key is "player" the atlasURL will be set to "player.json".</p>
<p>If you do not desire this action then provide URLs and / or a data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>Unique asset key of the texture atlas file.</p></td>
</tr>
<tr>
<tdclass="name"><code>textureURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas image file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas data file. If undefined or <code>null</code> and no atlasData is given, the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.json".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasData</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>A JSON data object. You don't need this if the data is being loaded from a URL.</p></td>
<p>If using Texture Packer we recommend you enable "Trim sprite names".<br>If your atlas software has an option to "rotate" the resulting frames, you must disable it.</p>
<p>You can choose to either load the data externally, by providing a URL to a json file.<br>Or you can pass in a JSON object or String via the <code>atlasData</code> parameter.<br>If you pass a String the data is automatically run through <code>JSON.parse</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getImage(key)</code>. JSON files are automatically parsed upon load.<br>If you need to control when the JSON is parsed then use <code>Loader.text</code> instead and parse the JSON file as needed.</p>
<p>The URLs can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the textureURL isn't specified then the Loader will take the key and create a filename from that.<br>For example if the key is "player" and textureURL is null then the Loader will set the URL to be "player.png".<br>The same is true for the atlasURL. If atlasURL isn't specified and no atlasData has been provided then the Loader will<br>set the atlasURL to be the key. For example if the key is "player" the atlasURL will be set to "player.json".</p>
<p>If you do not desire this action then provide URLs and / or a data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>Unique asset key of the texture atlas file.</p></td>
</tr>
<tr>
<tdclass="name"><code>textureURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas image file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas data file. If undefined or <code>null</code> and no atlasData is given, the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.json".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasData</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>A JSON data object. You don't need this if the data is being loaded from a URL.</p></td>
<p>If using Texture Packer we recommend you enable "Trim sprite names".<br>If your atlas software has an option to "rotate" the resulting frames, you must disable it.</p>
<p>You can choose to either load the data externally, by providing a URL to an xml file.<br>Or you can pass in an XML object or String via the <code>atlasData</code> parameter.<br>If you pass a String the data is automatically run through <code>Loader.parseXML</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getImage(key)</code>. XML files are automatically parsed upon load.<br>If you need to control when the XML is parsed then use <code>Loader.text</code> instead and parse the XML file as needed.</p>
<p>The URLs can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the textureURL isn't specified then the Loader will take the key and create a filename from that.<br>For example if the key is "player" and textureURL is null then the Loader will set the URL to be "player.png".<br>The same is true for the atlasURL. If atlasURL isn't specified and no atlasData has been provided then the Loader will<br>set the atlasURL to be the key. For example if the key is "player" the atlasURL will be set to "player.xml".</p>
<p>If you do not desire this action then provide URLs and / or a data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>Unique asset key of the texture atlas file.</p></td>
</tr>
<tr>
<tdclass="name"><code>textureURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas image file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>URL of the texture atlas data file. If undefined or <code>null</code> and no atlasData is given, the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.xml".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasData</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>An XML data object. You don't need this if the data is being loaded from a URL.</p></td>
<p>Adds an audio file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getSound(key)</code>.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>Mobile warning: There are some mobile devices (certain iPad 2 and iPad Mini revisions) that cannot play 48000 Hz audio.<br>When they try to play the audio becomes extremely distorted and buzzes, eventually crashing the sound system.<br>The solution is to use a lower encoding rate such as 44100 Hz.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the audio file.</p></td>
</tr>
<tr>
<tdclass="name"><code>urls</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
|
<spanclass="param-type">Array.<string></span>
|
<spanclass="param-type">Array.<object></span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Either a single string or an array of URIs or pairs of <code>{uri: .., type: ..}</code>.<br> If an array is specified then the first URI (or URI + mime pair) that is device-compatible will be selected.<br> For example: <code>"jump.mp3"</code>, <code>['jump.mp3', 'jump.ogg', 'jump.m4a']</code>, or <code>[{uri: "data:<opus_resource>", type: 'opus'}, 'fallback.mp3']</code>.<br> BLOB and DATA URIs can be used but only support automatic detection when used in the pair form; otherwise the format must be manually checked before adding the resource.</p></td>
</tr>
<tr>
<tdclass="name"><code>autoDecode</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
true
</td>
<tdclass="description last"><p>When using Web Audio the audio files can either be decoded at load time or run-time.<br> Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.</p></td>
<p>A legacy alias for Loader.audioSprite. Please see that method for documentation.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the audio file.</p></td>
</tr>
<tr>
<tdclass="name"><code>urls</code></td>
<tdclass="type">
<spanclass="param-type">Array</span>
|
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>An array containing the URLs of the audio files, i.e.: [ 'audiosprite.mp3', 'audiosprite.ogg', 'audiosprite.m4a' ] or a single string containing just one URL.</p></td>
</tr>
<tr>
<tdclass="name"><code>jsonURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>The URL of the audiosprite configuration JSON object. If you wish to pass the data directly set this parameter to null.</p></td>
</tr>
<tr>
<tdclass="name"><code>jsonData</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
|
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>A JSON object or string containing the audiosprite configuration data. This is ignored if jsonURL is not null.</p></td>
</tr>
<tr>
<tdclass="name"><code>autoDecode</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
true
</td>
<tdclass="description last"><p>When using Web Audio the audio files can either be decoded at load time or run-time.<br> Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.</p></td>
<p>Adds an audio sprite file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Audio Sprites are a combination of audio files and a JSON configuration.</p>
<p>The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite</p>
<p>Retrieve the file via <code>Cache.getSoundData(key)</code>.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the audio file.</p></td>
</tr>
<tr>
<tdclass="name"><code>urls</code></td>
<tdclass="type">
<spanclass="param-type">Array</span>
|
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>An array containing the URLs of the audio files, i.e.: [ 'audiosprite.mp3', 'audiosprite.ogg', 'audiosprite.m4a' ] or a single string containing just one URL.</p></td>
</tr>
<tr>
<tdclass="name"><code>jsonURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>The URL of the audiosprite configuration JSON object. If you wish to pass the data directly set this parameter to null.</p></td>
</tr>
<tr>
<tdclass="name"><code>jsonData</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
|
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>A JSON object or string containing the audiosprite configuration data. This is ignored if jsonURL is not null.</p></td>
</tr>
<tr>
<tdclass="name"><code>autoDecode</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
true
</td>
<tdclass="description last"><p>When using Web Audio the audio files can either be decoded at load time or run-time.<br> Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.</p></td>
<p>Adds a binary file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getBinary(key)</code>.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.bin". It will always add <code>.bin</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
<p>It will be loaded via xhr with a responseType of "arraybuffer". You can specify an optional callback to process the file after load.<br>When the callback is called it will be passed 2 parameters: the key of the file and the file data.</p>
<p>WARNING: If a callback is specified the data will be set to whatever it returns. Always return the data object, even if you didn't modify it.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the binary file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the binary file. If undefined or <code>null</code> the url will be set to <code><key>.bin</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.bin".</p></td>
</tr>
<tr>
<tdclass="name"><code>callback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
(none)
</td>
<tdclass="description last"><p>Optional callback that will be passed the file after loading, so you can perform additional processing on it.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The context under which the callback will be applied. If not specified it will use the callback itself as the context.</p></td>
<p>You can choose to either load the data externally, by providing a URL to an xml file.<br>Or you can pass in an XML object or String via the <code>xmlData</code> parameter.<br>If you pass a String the data is automatically run through <code>Loader.parseXML</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getBitmapFont(key)</code>. XML files are automatically parsed upon load.<br>If you need to control when the XML is parsed then use <code>Loader.text</code> instead and parse the XML file as needed.</p>
<p>The URLs can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the textureURL isn't specified then the Loader will take the key and create a filename from that.<br>For example if the key is "megaFont" and textureURL is null then the Loader will set the URL to be "megaFont.png".<br>The same is true for the atlasURL. If atlasURL isn't specified and no atlasData has been provided then the Loader will<br>set the atlasURL to be the key. For example if the key is "megaFont" the atlasURL will be set to "megaFont.xml".</p>
<p>If you do not desire this action then provide URLs and / or a data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the bitmap font.</p></td>
</tr>
<tr>
<tdclass="name"><code>textureURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the Bitmap Font texture file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "megaFont" then the URL will be "megaFont.png".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasURL</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the Bitmap Font atlas file (xml/json). If undefined or <code>null</code> AND <code>atlasData</code> is null, the url will be set to <code><key>.xml</code>, i.e. if <code>key</code> was "megaFont" then the URL will be "megaFont.xml".</p></td>
</tr>
<tr>
<tdclass="name"><code>atlasData</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>An optional Bitmap Font atlas in string form (stringified xml/json).</p></td>
</tr>
<tr>
<tdclass="name"><code>xSpacing</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>If you'd like to add additional horizontal spacing between the characters then set the pixel value here.</p></td>
</tr>
<tr>
<tdclass="name"><code>ySpacing</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>If you'd like to add additional vertical spacing between the lines then set the pixel value here.</p></td>
<p>Only assets in the download file queue will be found.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>type</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="description last"><p>The type asset you want to check.</p></td>
</tr>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="description last"><p>Key of the asset you want to check.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">any</span>
-
</div>
<divclass="returns-desc param-desc">
<p>Returns an object if found that has 2 properties: <code>index</code> and <code>file</code>; otherwise a non-true value is returned.<br> The index may change and should only be used immediately following this call.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the image via <code>Cache.getImage(key)</code></p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.png". It will always add <code>.png</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
<p>This method also supports passing in a texture object as the <code>url</code> argument. This allows you to load<br>compressed textures into Phaser. You can also use <code>Loader.texture</code> to do this.</p>
<p>Compressed Textures are a WebGL only feature, and require 3rd party tools to create.<br>Available tools include Texture Packer, PVRTexTool, DirectX Texture Tool and Mali Texture Compression Tool.</p>
<p>Supported texture compression formats are: PVRTC, S3TC and ETC1.<br>Supported file formats are: PVR, DDS, KTX and PKM.</p>
<p>The formats that support all 3 compression algorithms are PVR and KTX.<br>PKM only supports ETC1, and DDS only S3TC for now.</p>
});</code></pre><p>The <code>truecolor</code> property points to a standard PNG file, that will be used if none of the<br>compressed formats are supported by the browser / GPU.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of this image file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
|
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of an image file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png". Can also be a texture data object.</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.</p></td>
<p>Adds an array of images to the current load queue.</p>
<p>It works by passing each element of the array to the Loader.image method.</p>
<p>The files are <strong>not</strong> loaded immediately after calling this method. The files are added to the queue ready to be loaded when the loader starts.</p>
<p>Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.</p>
<p>The keys must be unique Strings. They are used to add the files to the Phaser.Cache upon successful load.</p>
<p>Retrieve the images via <code>Cache.getImage(key)</code></p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.png". It will always add <code>.png</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>keys</code></td>
<tdclass="type">
<spanclass="param-type">array</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>An array of unique asset keys of the image files.</p></td>
</tr>
<tr>
<tdclass="name"><code>urls</code></td>
<tdclass="type">
<spanclass="param-type">array</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>Optional array of URLs. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png". If provided the URLs array length must match the keys array length.</p></td>
<p>Adds a JSON file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getJSON(key)</code>. JSON files are automatically parsed upon load.<br>If you need to control when the JSON is parsed then use <code>Loader.text</code> instead and parse the text file as needed.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.json". It will always add <code>.json</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the json file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the JSON file. If undefined or <code>null</code> the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.json".</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.</p></td>
<p>A packfile is a JSON file that contains a list of assets to the be loaded.<br>Please see the example 'loader/asset pack' in the Phaser Examples repository.</p>
<p>The URL of the packfile can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of this resource pack.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the Asset Pack JSON file. If you wish to pass a json object instead set this to null and pass the object as the data parameter.</p></td>
</tr>
<tr>
<tdclass="name"><code>data</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Asset Pack JSON data. Use this to pass in a json data object rather than loading it from a URL. TODO</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
(loader)
</td>
<tdclass="description last"><p>Some Loader operations, like Binary and Script require a context for their callbacks. Pass the context here.</p></td>
<p>Adds a physics data file to the current load queue.</p>
<p>The data must be in <code>Lime + Corona</code> JSON format. <ahref="https://www.codeandweb.com">Physics Editor</a> by code'n'web exports in this format natively.</p>
<p>You can choose to either load the data externally, by providing a URL to a json file.<br>Or you can pass in a JSON object or String via the <code>data</code> parameter.<br>If you pass a String the data is automatically run through <code>JSON.parse</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getJSON(key)</code>. JSON files are automatically parsed upon load.<br>If you need to control when the JSON is parsed then use <code>Loader.text</code> instead and parse the text file as needed.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified and no data is given then the Loader will take the key and create a filename from that.<br>For example if the key is "alien" and no URL or data is given then the Loader will set the URL to be "alien.json".<br>It will always use <code>.json</code> as the extension.</p>
<p>If you do not desire this action then provide a URL or data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the physics json data.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the physics data file. If undefined or <code>null</code> and no data is given the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.json".</p></td>
</tr>
<tr>
<tdclass="name"><code>data</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
|
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>An optional JSON data object. If given then the url is ignored and this JSON object is used for physics data instead.</p></td>
</tr>
<tr>
<tdclass="name"><code>format</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
Phaser.Physics.LIME_CORONA_JSON
</td>
<tdclass="description last"><p>The format of the physics data.</p></td>
<p>Adds a JavaScript file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.js". It will always add <code>.js</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
<p>A callback, which will be invoked as the script tag has been created, can also be specified.<br>The callback must return relevant <code>data</code>.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the script file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the JavaScript file. If undefined or <code>null</code> the url will be set to <code><key>.js</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.js".</p></td>
</tr>
<tr>
<tdclass="name"><code>callback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
(none)
</td>
<tdclass="description last"><p>Optional callback that will be called after the script tag has loaded, so you can perform additional processing.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
(loader)
</td>
<tdclass="description last"><p>The context under which the callback will be applied. If not specified it will use the Phaser Loader as the context.</p></td>
<p>A "preload" sprite will have its width or height crop adjusted based on the percentage of the loader in real-time.<br>This allows you to easily make loading bars for games.</p>
<tdclass="description last"><p>The sprite or image that will be cropped during the load.</p></td>
</tr>
<tr>
<tdclass="name"><code>direction</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>A value of zero means the sprite will be cropped horizontally, a value of 1 means its will be cropped vertically.</p></td>
<p>Adds a fragment shader file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getShader(key)</code>.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "blur"<br>and no URL is given then the Loader will set the URL to be "blur.frag". It will always add <code>.frag</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the fragment file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the fragment file. If undefined or <code>null</code> the url will be set to <code><key>.frag</code>, i.e. if <code>key</code> was "blur" then the URL will be "blur.frag".</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.</p></td>
<p>Adds a Sprite Sheet to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>To clarify the terminology that Phaser uses: A Sprite Sheet is an image containing frames, usually of an animation, that are all equal<br>dimensions and often in sequence. For example if the frame size is 32x32 then every frame in the sprite sheet will be that size.<br>Sometimes (outside of Phaser) the term "sprite sheet" is used to refer to a texture atlas.<br>A Texture Atlas works by packing together images as best it can, using whatever frame sizes it likes, often with cropping and trimming<br>the frames in the process. Software such as Texture Packer, Flash CC or Shoebox all generate texture atlases, not sprite sheets.<br>If you've got an atlas then use <code>Loader.atlas</code> instead.</p>
<p>The key must be a unique String. It is used to add the image to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getImage(key)</code>. Sprite sheets, being image based, live in the same Cache as all other Images.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.png". It will always add <code>.png</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the sheet file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the sprite sheet file. If undefined or <code>null</code> the url will be set to <code><key>.png</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.png".</p></td>
</tr>
<tr>
<tdclass="name"><code>frameWidth</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Width in pixels of a single frame in the sprite sheet.</p></td>
</tr>
<tr>
<tdclass="name"><code>frameHeight</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Height in pixels of a single frame in the sprite sheet.</p></td>
</tr>
<tr>
<tdclass="name"><code>frameMax</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
-1
</td>
<tdclass="description last"><p>How many frames in this sprite sheet. If not specified it will divide the whole image into frames.</p></td>
</tr>
<tr>
<tdclass="name"><code>margin</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>If the frames have been drawn with a margin, specify the amount here.</p></td>
</tr>
<tr>
<tdclass="name"><code>spacing</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>If the frames have been drawn with spacing between them, specify the amount here.</p></td>
</tr>
<tr>
<tdclass="name"><code>skipFrames</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>Skip a number of frames. Useful when there are multiple sprite sheets in one image.</p></td>
<p>Adds a Text file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getText(key)</code></p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.txt". It will always add <code>.txt</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the text file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the text file. If undefined or <code>null</code> the url will be set to <code><key>.txt</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.txt".</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.</p></td>
<p>Adds a Compressed Texture Image to the current load queue.</p>
<p>Compressed Textures are a WebGL only feature, and require 3rd party tools to create.<br>Available tools include Texture Packer, PVRTexTool, DirectX Texture Tool and Mali Texture Compression Tool.</p>
<p>Supported texture compression formats are: PVRTC, S3TC and ETC1.<br>Supported file formats are: PVR, DDS, KTX and PKM.</p>
<p>The formats that support all 3 compression algorithms are PVR and KTX.<br>PKM only supports ETC1, and DDS only S3TC for now.</p>
});</code></pre><p>The <code>truecolor</code> property points to a standard PNG file, that will be used if none of the<br>compressed formats are supported by the browser / GPU.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the image via <code>Cache.getImage(key)</code></p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.pvr". It will always add <code>.pvr</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of this image file.</p></td>
</tr>
<tr>
<tdclass="name"><code>object</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The texture path data object.</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.</p></td>
<p>Phaser can load data in two different formats: CSV and Tiled JSON.</p>
<p>Tiled is a free software package, specifically for creating tilemaps, and is available from http://www.mapeditor.org</p>
<p>You can choose to either load the data externally, by providing a URL to a json file.<br>Or you can pass in a JSON object or String via the <code>data</code> parameter.<br>If you pass a String the data is automatically run through <code>JSON.parse</code> and then immediately added to the Phaser.Cache.</p>
<p>Retrieve the file via <code>Cache.getTilemapData(key)</code>. JSON files are automatically parsed upon load.<br>If you need to control when the JSON is parsed then use <code>Loader.text</code> instead and parse the text file as needed.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified and no data is given then the Loader will take the key and create a filename from that.<br>For example if the key is "level1" and no URL or data is given then the Loader will set the URL to be "level1.json".<br>If you set the format to be Tilemap.CSV it will set the URL to be "level1.csv" instead.</p>
<p>If you do not desire this action then provide a URL or data object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the tilemap data.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the tile map file. If undefined or <code>null</code> and no data is given the url will be set to <code><key>.json</code>, i.e. if <code>key</code> was "level1" then the URL will be "level1.json".</p></td>
</tr>
<tr>
<tdclass="name"><code>data</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
|
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>An optional JSON data object. If given then the url is ignored and this JSON object is used for map data instead.</p></td>
</tr>
<tr>
<tdclass="name"><code>format</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
Phaser.Tilemap.CSV
</td>
<tdclass="description last"><p>The format of the map data. Either Phaser.Tilemap.CSV or Phaser.Tilemap.TILED_JSON.</p></td>
<p>Adds a video file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getVideo(key)</code>.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>You don't need to preload a video in order to play it in your game. See <code>Video.createVideoFromURL</code> for details.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the video file.</p></td>
</tr>
<tr>
<tdclass="name"><code>urls</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
|
<spanclass="param-type">Array.<string></span>
|
<spanclass="param-type">Array.<object></span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Either a single string or an array of URIs or pairs of <code>{uri: .., type: ..}</code>.<br> If an array is specified then the first URI (or URI + mime pair) that is device-compatible will be selected.<br> For example: <code>"boom.mp4"</code>, <code>['boom.mp4', 'boom.ogg', 'boom.webm']</code>, or <code>[{uri: "data:<opus_resource>", type: 'opus'}, 'fallback.mp4']</code>.<br> BLOB and DATA URIs can be used but only support automatic detection when used in the pair form; otherwise the format must be manually checked before adding the resource.</p></td>
</tr>
<tr>
<tdclass="name"><code>loadEvent</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
'canplaythrough'
</td>
<tdclass="description last"><p>This sets the Video source event to listen for before the load is considered complete.<br> 'canplaythrough' implies the video has downloaded enough, and bandwidth is high enough that it can be played to completion.<br> 'canplay' implies the video has downloaded enough to start playing, but not necessarily to finish.<br> 'loadeddata' just makes sure that the video meta data and first frame have downloaded. Phaser uses this value automatically if the<br> browser is detected as being Firefox and no <code>loadEvent</code> is given, otherwise it defaults to <code>canplaythrough</code>.</p></td>
</tr>
<tr>
<tdclass="name"><code>asBlob</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>Video files can either be loaded via the creation of a video element which has its src property set.<br> Or they can be loaded via xhr, stored as binary data in memory and then converted to a Blob. This isn't supported in IE9 or Android 2.<br> If you need to have the same video playing at different times across multiple Sprites then you need to load it as a Blob.</p></td>
<p>A synchronization point denotes that an asset <em>must</em> be completely loaded before<br>subsequent assets can be loaded. An asset marked as a sync-point does not need to wait<br>for previous assets to load (unless they are sync-points). Resources, such as packs, may still<br>be downloaded around sync-points, as long as they do not finalize loading.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>callback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The callback is invoked and is supplied with a single argument: the loader.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
(loader)
</td>
<tdclass="description last"><p>Context for the callback.</p></td>
<p>Adds an XML file to the current load queue.</p>
<p>The file is <strong>not</strong> loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.</p>
<p>The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.</p>
<p>Retrieve the file via <code>Cache.getXML(key)</code>.</p>
<p>The URL can be relative or absolute. If the URL is relative the <code>Loader.baseURL</code> and <code>Loader.path</code> values will be prepended to it.</p>
<p>If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"<br>and no URL is given then the Loader will set the URL to be "alien.xml". It will always add <code>.xml</code> as the extension.<br>If you do not desire this action then provide a URL.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>key</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>Unique asset key of the xml file.</p></td>
</tr>
<tr>
<tdclass="name"><code>url</code></td>
<tdclass="type">
<spanclass="param-type">string</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>URL of the XML file. If undefined or <code>null</code> the url will be set to <code><key>.xml</code>, i.e. if <code>key</code> was "alien" then the URL will be "alien.xml".</p></td>
</tr>
<tr>
<tdclass="name"><code>overwrite</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.</p></td>