UNPKG

phaser

Version:

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.

3,041 lines (1,183 loc) 147 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Phaser Class: Loader</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <a class="brand" href="index.html">Phaser</a> <ul class="nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Phaser.html">Phaser</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"> <a href="Phaser.Animation.html">Animation</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationManager.html">AnimationManager</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationParser.html">AnimationParser</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayList.html">ArrayList</a> </li> <li class="class-depth-1"> <a href="Phaser.AudioSprite.html">AudioSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapData.html">BitmapData</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="Phaser.Button.html">Button</a> </li> <li class="class-depth-1"> <a href="Phaser.Cache.html">Cache</a> </li> <li class="class-depth-1"> <a href="Phaser.Camera.html">Camera</a> </li> <li class="class-depth-1"> <a href="Phaser.Canvas.html">Canvas</a> </li> <li class="class-depth-1"> <a href="Phaser.Circle.html">Circle</a> </li> <li class="class-depth-1"> <a href="Phaser.Color.html">Color</a> </li> <li class="class-depth-1"> <a href="Phaser.Device.html">Device</a> </li> <li class="class-depth-1"> <a href="Phaser.Easing.html">Easing</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Back.html">Back</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Bounce.html">Bounce</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Circular.html">Circular</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Cubic.html">Cubic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Elastic.html">Elastic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Exponential.html">Exponential</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Linear.html">Linear</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quadratic.html">Quadratic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quartic.html">Quartic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quintic.html">Quintic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> </li> <li class="class-depth-1"> <a href="Phaser.Ellipse.html">Ellipse</a> </li> <li class="class-depth-1"> <a href="Phaser.Events.html">Events</a> </li> <li class="class-depth-1"> <a href="Phaser.Filter.html">Filter</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexGrid.html">FlexGrid</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexLayer.html">FlexLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.Frame.html">Frame</a> </li> <li class="class-depth-1"> <a href="Phaser.FrameData.html">FrameData</a> </li> <li class="class-depth-1"> <a href="Phaser.Game.html">Game</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectCreator.html">GameObjectCreator</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> </li> <li class="class-depth-1"> <a href="Phaser.Gamepad.html">Gamepad</a> </li> <li class="class-depth-1"> <a href="Phaser.GamepadButton.html">GamepadButton</a> </li> <li class="class-depth-1"> <a href="Phaser.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="Phaser.Group.html">Group</a> </li> <li class="class-depth-1"> <a href="Phaser.Image.html">Image</a> </li> <li class="class-depth-1"> <a href="Phaser.Input.html">Input</a> </li> <li class="class-depth-1"> <a href="Phaser.InputHandler.html">InputHandler</a> </li> <li class="class-depth-1"> <a href="Phaser.Key.html">Key</a> </li> <li class="class-depth-1"> <a href="Phaser.Keyboard.html">Keyboard</a> </li> <li class="class-depth-1"> <a href="Phaser.Line.html">Line</a> </li> <li class="class-depth-1"> <a href="Phaser.LinkedList.html">LinkedList</a> </li> <li class="class-depth-1"> <a href="Phaser.Loader.html">Loader</a> </li> <li class="class-depth-1"> <a href="Phaser.LoaderParser.html">LoaderParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Math.html">Math</a> </li> <li class="class-depth-1"> <a href="Phaser.Mouse.html">Mouse</a> </li> <li class="class-depth-1"> <a href="Phaser.MSPointer.html">MSPointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Net.html">Net</a> </li> <li class="class-depth-1"> <a href="Phaser.Particle.html">Particle</a> </li> <li class="class-depth-1"> <a href="Phaser.Particles.html">Particles</a> </li> <li class="class-depth-2"> <a href="Phaser.Particles.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a> </li> <li class="class-depth-1"> <a href="Phaser.Physics.html">Physics</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.Body.html">Body</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Ninja.html">Ninja</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.AABB.html">AABB</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Circle.html">Circle</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Tile.html">Tile</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.P2.html">P2</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Material.html">Material</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Spring.html">Spring</a> </li> <li class="class-depth-1"> <a href="Phaser.Plugin.html">Plugin</a> </li> <li class="class-depth-1"> <a href="Phaser.PluginManager.html">PluginManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Point.html">Point</a> </li> <li class="class-depth-1"> <a href="Phaser.Pointer.html">Pointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Polygon.html">Polygon</a> </li> <li class="class-depth-1"> <a href="Phaser.QuadTree.html">QuadTree</a> </li> <li class="class-depth-1"> <a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a> </li> <li class="class-depth-1"> <a href="Phaser.Rectangle.html">Rectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> </li> <li class="class-depth-1"> <a href="Phaser.RetroFont.html">RetroFont</a> </li> <li class="class-depth-1"> <a href="Phaser.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="Phaser.ScaleManager.html">ScaleManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Signal.html">Signal</a> </li> <li class="class-depth-1"> <a href="Phaser.SignalBinding.html">SignalBinding</a> </li> <li class="class-depth-1"> <a href="Phaser.SinglePad.html">SinglePad</a> </li> <li class="class-depth-1"> <a href="Phaser.Sound.html">Sound</a> </li> <li class="class-depth-1"> <a href="Phaser.SoundManager.html">SoundManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="Phaser.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="Phaser.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="Phaser.State.html">State</a> </li> <li class="class-depth-1"> <a href="Phaser.StateManager.html">StateManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="Phaser.Tile.html">Tile</a> </li> <li class="class-depth-1"> <a href="Phaser.Tilemap.html">Tilemap</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapLayer.html">TilemapLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapParser.html">TilemapParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Tileset.html">Tileset</a> </li> <li class="class-depth-1"> <a href="Phaser.TileSprite.html">TileSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.Time.html">Time</a> </li> <li class="class-depth-1"> <a href="Phaser.Timer.html">Timer</a> </li> <li class="class-depth-1"> <a href="Phaser.TimerEvent.html">TimerEvent</a> </li> <li class="class-depth-1"> <a href="Phaser.Touch.html">Touch</a> </li> <li class="class-depth-1"> <a href="Phaser.Tween.html">Tween</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenManager.html">TweenManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Utils.html">Utils</a> </li> <li class="class-depth-2"> <a href="Phaser.Utils.Debug.html">Debug</a> </li> <li class="class-depth-1"> <a href="Phaser.World.html">World</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <h1 class="page-title">Class: Loader</h1> <section> <header> <h2> <span class="ancestors"><a href="Phaser.html">Phaser</a>.</span> Loader </h2> <div class="class-description"><p>Phaser.Loader</p></div> </header> <article> <div class="container-overview"> <dt> <h4 class="name" id="Loader"><span class="type-signature"></span>new Loader<span class="signature">(game)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>The Loader handles loading all external content such as Images, Sounds, Texture Atlases and data files. It uses a combination of Image() loading and xhr and provides progress and completion callbacks.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>game</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span> </td> <td class="description last"><p>A reference to the currently running game.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-16">line 16</a> </li></ul></dd> </dl> </dd> </div> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name" id="PHYSICS_LIME_CORONA_JSON"><span class="type-signature">&lt;static, constant> </span>PHYSICS_LIME_CORONA_JSON<span class="type-signature"> :number</span></h4> </dt> <dd> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-173">line 173</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="PHYSICS_PHASER_JSON"><span class="type-signature">&lt;static, constant> </span>PHYSICS_PHASER_JSON<span class="type-signature"> :number</span></h4> </dt> <dd> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-179">line 179</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="TEXTURE_ATLAS_JSON_ARRAY"><span class="type-signature">&lt;static, constant> </span>TEXTURE_ATLAS_JSON_ARRAY<span class="type-signature"> :number</span></h4> </dt> <dd> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-155">line 155</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="TEXTURE_ATLAS_JSON_HASH"><span class="type-signature">&lt;static, constant> </span>TEXTURE_ATLAS_JSON_HASH<span class="type-signature"> :number</span></h4> </dt> <dd> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-161">line 161</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="TEXTURE_ATLAS_XML_STARLING"><span class="type-signature">&lt;static, constant> </span>TEXTURE_ATLAS_XML_STARLING<span class="type-signature"> :number</span></h4> </dt> <dd> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-167">line 167</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="baseURL"><span class="type-signature"></span>baseURL<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>If you want to append a URL before the path of any asset you can set this here. Useful if you need to allow an asset url to be configured outside of the game code. MUST have / on the end of it!</p> </div> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>baseURL</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-69">line 69</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="crossOrigin"><span class="type-signature"></span>crossOrigin<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>crossOrigin</code></td> <td class="type"> <span class="param-type">boolean</span> | <span class="param-type">string</span> </td> <td class="description last"><p>The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>false</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-60">line 60</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="game"><span class="type-signature"></span>game<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>game</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span> </td> <td class="description last"><p>Local reference to game.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-21">line 21</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="hasLoaded"><span class="type-signature"></span>hasLoaded<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>hasLoaded</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>True if all assets in the queue have finished loading.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>false</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-33">line 33</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="isLoading"><span class="type-signature"></span>isLoading<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>isLoading</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>True if the Loader is in the process of loading the queue.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>false</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-27">line 27</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="onFileComplete"><span class="type-signature"></span>onFileComplete<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onFileComplete</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span> </td> <td class="description last"><p>This event is dispatched when a file completes loading successfully.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-84">line 84</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="onFileError"><span class="type-signature"></span>onFileError<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onFileError</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span> </td> <td class="description last"><p>This event is dispatched when a file errors as a result of the load request.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-89">line 89</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="onFileStart"><span class="type-signature"></span>onFileStart<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onFileStart</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span> </td> <td class="description last"><p>This event is dispatched immediately before a file starts loading. It's possible the file may still error (404, etc) after this event is sent.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-79">line 79</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="onLoadComplete"><span class="type-signature"></span>onLoadComplete<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onLoadComplete</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span> </td> <td class="description last"><p>This event is dispatched when the final file in the load queue has either loaded or failed.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-94">line 94</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="onLoadStart"><span class="type-signature"></span>onLoadStart<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onLoadStart</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span> </td> <td class="description last"><p>This event is dispatched when the loading process starts, before the first file has been requested.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-74">line 74</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="onPackComplete"><span class="type-signature"></span>onPackComplete<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onPackComplete</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span> </td> <td class="description last"><p>This event is dispatched when an asset pack has either loaded or failed.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-99">line 99</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="preloadSprite"><span class="type-signature"></span>preloadSprite<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>You can optionally link a sprite to the preloader. If you do so the Sprites width or height will be cropped based on the percentage loaded. This property is an object containing: sprite, rect, direction, width and height</p> </div> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>preloadSprite</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-54">line 54</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="progress"><span class="type-signature"></span>progress<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>progress</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The rounded load progress percentage value (from 0 to 100)</p></td> </tr> </tbody> </table> </dl> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>0</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-39">line 39</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="progressFloat"><span class="type-signature"></span>progressFloat<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>progressFloat</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The non-rounded load progress value (from 0.0 to 100.0)</p></td> </tr> </tbody> </table> </dl> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>0</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-45">line 45</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="useXDomainRequest"><span class="type-signature"></span>useXDomainRequest<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>useXDomainRequest</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true and if the browser supports XDomainRequest, it will be used in preference for xhr when loading json files. It is enabled automatically if the browser is IE9, but you can disable it as required.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-104">line 104</a> </li></ul></dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="addToFileList"><span class="type-signature">&lt;protected> </span>addToFileList<span class="signature">(type, key, url, properties)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Internal function that adds a new entry to the file list. Do not call directly.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The type of resource to add to the list (image, audio, xml, etc).</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The unique Cache ID key of this resource.</p></td> </tr> <tr> <td class="name"><code>url</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The URL the asset will be loaded from.</p></td> </tr> <tr> <td class="name"><code>properties</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>Any additional properties needed to load the file.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-309">line 309</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="atlas"><span class="type-signature"></span>atlas<span class="signature">(key, textureURL, <span class="optional">atlasURL</span>, <span class="optional">atlasData</span>, <span class="optional">format</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.Loader.html">Phaser.Loader</a>}</span></h4> </dt> <dd> <div class="description"> <p>Add a new texture atlas to the loader.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last"><p>Unique asset key of the texture atlas file.</p></td> </tr> <tr> <td class="name"><code>textureURL</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last"><p>The url of the texture atlas image file.</p></td> </tr> <tr> <td class="name"><code>atlasURL</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The url of the texture atlas data file (json/xml). You don't need this if you are passing an atlasData object instead.</p></td> </tr> <tr> <td class="name"><code>atlasData</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="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> <td class="name"><code>format</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A value describing the format of the data, the default is Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Loader.js.html">loader/Loader.js</a>, <a href="Loader.js.html#sunlight-1-line-845">line 845</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>This Loader instance.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="Phaser.Loader.html">Phaser.Loader</a></span> </dd> </dl> </dd> <dt> <h4 class="name" id="atlasJSONArray"><span class="type-signature"></span>atlasJSONArray<span class="signature">(key, textureURL, <span class="optional">atlasURL</span>, <span class="optional">atlasData</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.Loader.html">Phaser.Loader</a>}</span></h4> </dt> <dd> <div class="description"> <p>Ad