phaser/docs/Phaser.Cache.html
2014-02-05 16:55:02 +00:00

7099 lines
No EOL
89 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Class: Cache</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>
<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>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<h1 class="page-title">Class: Cache</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="Phaser.html">Phaser</a>.</span>
Cache
</h2>
<div class="class-description"><p>A game only has one instance of a Cache and it is used to store all externally loaded assets such as images, sounds and data files as a result of Loader calls. Cached items use string based keys for look-up.</p></div>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="Cache"><span class="type-signature"></span>new Cache<span class="signature">(game)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Phaser.Cache constructor.</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="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-15">line 15</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<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="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-20">line 20</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onSoundUnlock"><span class="type-signature"></span>onSoundUnlock<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>onSoundUnlock</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 sound system is unlocked via a touch event on cellular devices.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-76">line 76</a>
</li></ul></dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="addBinary"><span class="type-signature"></span>addBinary<span class="signature">(key, binaryData)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a binary object in to the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for this binary data.</p></td>
</tr>
<tr>
<td class="name"><code>binaryData</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>The binary object to be addded to the cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-95">line 95</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addBitmapData"><span class="type-signature"></span>addBitmapData<span class="signature">(key, bitmapData)</span><span class="type-signature"> &rarr; {<a href="Phaser.BitmapData.html">Phaser.BitmapData</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Add a BitmapData object in to the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for this BitmapData.</p></td>
</tr>
<tr>
<td class="name"><code>bitmapData</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.BitmapData.html">Phaser.BitmapData</a></span>
</td>
<td class="description last"><p>The BitmapData object to be addded to the cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-107">line 107</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The BitmapData object to be addded to the cache.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.BitmapData.html">Phaser.BitmapData</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addBitmapFont"><span class="type-signature"></span>addBitmapFont<span class="signature">(key, url, data, xmlData)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new Bitmap Font.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The unique key by which you will reference this object.</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>URL of this font xml file.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Extra font data.</p></td>
</tr>
<tr>
<td class="name"><code>xmlData</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Texture atlas frames data.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-208">line 208</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addCanvas"><span class="type-signature"></span>addCanvas<span class="signature">(key, canvas, context)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new canvas object in to the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for this canvas.</p></td>
</tr>
<tr>
<td class="name"><code>canvas</code></td>
<td class="type">
<span class="param-type">HTMLCanvasElement</span>
</td>
<td class="description last"><p>Canvas DOM element.</p></td>
</tr>
<tr>
<td class="name"><code>context</code></td>
<td class="type">
<span class="param-type">CanvasRenderingContext2D</span>
</td>
<td class="description last"><p>Render context of this canvas.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-82">line 82</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addDefaultImage"><span class="type-signature"></span>addDefaultImage<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Adds a default image to be used in special cases such as WebGL Filters. Is mapped to the key __default.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-229">line 229</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addImage"><span class="type-signature"></span>addImage<span class="signature">(key, url, data)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new image.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The unique key by which you will reference this object.</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>URL of this image file.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Extra image data.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-282">line 282</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addMissingImage"><span class="type-signature"></span>addMissingImage<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Adds an image to be used when a key is wrong / missing. Is mapped to the key __missing.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-247">line 247</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addRenderTexture"><span class="type-signature"></span>addRenderTexture<span class="signature">(key, texture)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new Phaser.RenderTexture in to the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The unique key by which you will reference this object.</p></td>
</tr>
<tr>
<td class="name"><code>texture</code></td>
<td class="type">
<span class="param-type">Phaser.Texture</span>
</td>
<td class="description last"><p>The texture to use as the base of the RenderTexture.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-122">line 122</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addSound"><span class="type-signature"></span>addSound<span class="signature">(key, url, data, webAudio, audioTag)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new sound.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for the sound.</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>URL of this sound file.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Extra sound data.</p></td>
</tr>
<tr>
<td class="name"><code>webAudio</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>True if the file is using web audio.</p></td>
</tr>
<tr>
<td class="name"><code>audioTag</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>True if the file is using legacy HTML audio.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-301">line 301</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addSpriteSheet"><span class="type-signature"></span>addSpriteSheet<span class="signature">(key, url, data, frameWidth, frameHeight, <span class="optional">frameMax</span>, <span class="optional">margin</span>, <span class="optional">spacing</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new sprite sheet in to the cache.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</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="default">
</td>
<td class="description last"><p>The unique key by which you will reference this object.</p></td>
</tr>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>URL of this sprite sheet file.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>Extra sprite sheet data.</p></td>
</tr>
<tr>
<td class="name"><code>frameWidth</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>Width of the sprite sheet.</p></td>
</tr>
<tr>
<td class="name"><code>frameHeight</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>Height of the sprite sheet.</p></td>
</tr>
<tr>
<td class="name"><code>frameMax</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
-1
</td>
<td class="description last"><p>How many frames stored in the sprite sheet. If -1 then it divides the whole sheet evenly.</p></td>
</tr>
<tr>
<td class="name"><code>margin</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
0
</td>
<td class="description last"><p>If the frames have been drawn with a margin, specify the amount here.</p></td>
</tr>
<tr>
<td class="name"><code>spacing</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
0
</td>
<td class="description last"><p>If the frames have been drawn with spacing between them, specify the amount here.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-137">line 137</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addText"><span class="type-signature"></span>addText<span class="signature">(key, url, data)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new text data.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for the text data.</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>URL of this text data file.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Extra text data.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-265">line 265</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addTextureAtlas"><span class="type-signature"></span>addTextureAtlas<span class="signature">(key, url, data, atlasData, format)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new texture atlas.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The unique key by which you will reference this object.</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>URL of this texture atlas file.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Extra texture atlas data.</p></td>
</tr>
<tr>
<td class="name"><code>atlasData</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Texture atlas frames data.</p></td>
</tr>
<tr>
<td class="name"><code>format</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The format of the texture atlas.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-176">line 176</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addTilemap"><span class="type-signature"></span>addTilemap<span class="signature">(key, url, mapData, format)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new tilemap.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The unique key by which you will reference this object.</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>URL of the tilemap image.</p></td>
</tr>
<tr>
<td class="name"><code>mapData</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>The tilemap data object (either a CSV or JSON file).</p></td>
</tr>
<tr>
<td class="name"><code>format</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The format of the tilemap data.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-161">line 161</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="checkImageKey"><span class="type-signature"></span>checkImageKey<span class="signature">(key)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Checks if an image key exists.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the image to check is in the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-435">line 435</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the key exists, otherwise false.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="decodedSound"><span class="type-signature"></span>decodedSound<span class="signature">(key, data)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new decoded sound.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for the sound.</p></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Extra sound data.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-380">line 380</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Clears the cache. Removes every local cache object reference.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-819">line 819</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getBinary"><span class="type-signature"></span>getBinary<span class="signature">(key)</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get binary data by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the binary data object to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-705">line 705</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The binary data object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getBitmapData"><span class="type-signature"></span>getBitmapData<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.BitmapData.html">Phaser.BitmapData</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a BitmapData object from the cache by its key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the BitmapData object to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-415">line 415</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The requested BitmapData object if found, or null if not.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.BitmapData.html">Phaser.BitmapData</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getCanvas"><span class="type-signature"></span>getCanvas<span class="signature">(key)</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a canvas object from the cache by its key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the canvas to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-395">line 395</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The canvas object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFrame"><span class="type-signature"></span>getFrame<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.Frame.html">Phaser.Frame</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a single frame by key. You'd only do this to get the default Frame created for a non-atlas/spritesheet image.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the frame data to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-544">line 544</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFrameByIndex"><span class="type-signature"></span>getFrameByIndex<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.Frame.html">Phaser.Frame</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a single frame out of a frameData set by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the frame data to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-510">line 510</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFrameByName"><span class="type-signature"></span>getFrameByName<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.Frame.html">Phaser.Frame</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a single frame out of a frameData set by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the frame data to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-527">line 527</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFrameData"><span class="type-signature"></span>getFrameData<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.FrameData.html">Phaser.FrameData</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get frame data by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the frame data to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-493">line 493</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.FrameData.html">Phaser.FrameData</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getImage"><span class="type-signature"></span>getImage<span class="signature">(key)</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get image data by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the image to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-453">line 453</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The image data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getImageKeys"><span class="type-signature"></span>getImageKeys<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Array.html">Array</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns an array containing all of the keys of Images in the Cache.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-749">line 749</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The string based keys in the Cache.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Array.html">Array</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getKeys"><span class="type-signature"></span>getKeys<span class="signature">(array)</span><span class="type-signature"> &rarr; {<a href="Array.html">Array</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get the cache keys from a given array of objects.
Normally you don't call this directly but instead use getImageKeys, getSoundKeys, etc.</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>array</code></td>
<td class="type">
<span class="param-type"><a href="Array.html">Array</a></span>
</td>
<td class="description last"><p>An array of items to return the keys for.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-725">line 725</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The array of item keys.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Array.html">Array</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getSound"><span class="type-signature"></span>getSound<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.Sound.html">Phaser.Sound</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get sound by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the sound to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-598">line 598</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The sound object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Sound.html">Phaser.Sound</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getSoundData"><span class="type-signature"></span>getSoundData<span class="signature">(key)</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get sound data by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the sound to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-618">line 618</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The sound data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getSoundKeys"><span class="type-signature"></span>getSoundKeys<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Array.html">Array</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns an array containing all of the keys of Sounds in the Cache.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-759">line 759</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The string based keys in the Cache.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Array.html">Array</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getText"><span class="type-signature"></span>getText<span class="signature">(key)</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get text data by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the text data to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-685">line 685</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The text data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getTextKeys"><span class="type-signature"></span>getTextKeys<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Array.html">Array</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns an array containing all of the keys of Text Files in the Cache.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-769">line 769</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The string based keys in the Cache.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Array.html">Array</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getTexture"><span class="type-signature"></span>getTexture<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.RenderTexture.html">Phaser.RenderTexture</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a RenderTexture by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the RenderTexture to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-578">line 578</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The RenderTexture object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.RenderTexture.html">Phaser.RenderTexture</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getTextureFrame"><span class="type-signature"></span>getTextureFrame<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Phaser.Frame.html">Phaser.Frame</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get a single texture frame by key. You'd only do this to get the default Frame created for a non-atlas/spritesheet image.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the frame to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-561">line 561</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getTilemap"><span class="type-signature"></span>getTilemap<span class="signature">(key)</span><span class="type-signature"> &rarr; {Object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get tilemap data by key.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the tilemap data to retrieve from the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-473">line 473</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The raw tilemap data in CSV or JSON format.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="isSoundDecoded"><span class="type-signature"></span>isSoundDecoded<span class="signature">(key)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Check if the given sound has finished decoding.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the sound in the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-638">line 638</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The decoded state of the Sound object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="isSoundReady"><span class="type-signature"></span>isSoundReady<span class="signature">(key)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Check if the given sound is ready for playback. A sound is considered ready when it has finished decoding and the device is no longer touch locked.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the sound in the Cache.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-654">line 654</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the sound is decoded and the device is not touch locked.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="isSpriteSheet"><span class="type-signature"></span>isSpriteSheet<span class="signature">(key)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Check whether an image asset is sprite sheet or not.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key of the sprite sheet you want.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-667">line 667</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the image is a sprite sheet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="reloadSound"><span class="type-signature"></span>reloadSound<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Reload a sound.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for the sound.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-327">line 327</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="reloadSoundComplete"><span class="type-signature"></span>reloadSoundComplete<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Fires the onSoundUnlock event when the sound has completed reloading.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for the sound.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-349">line 349</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeCanvas"><span class="type-signature"></span>removeCanvas<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a canvas from the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Key of the asset you want to remove.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-779">line 779</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeImage"><span class="type-signature"></span>removeImage<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Removes an image from the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Key of the asset you want to remove.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-789">line 789</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeSound"><span class="type-signature"></span>removeSound<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a sound from the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Key of the asset you want to remove.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-799">line 799</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeText"><span class="type-signature"></span>removeText<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a text from the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Key of the asset you want to remove.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-809">line 809</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="updateSound"><span class="type-signature"></span>updateSound<span class="signature">(key)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Updates the sound object in the cache.</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>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Asset key for the sound.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Cache.js.html">loader/Cache.js</a>, <a href="Cache.js.html#sunlight-1-line-365">line 365</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<div class="span3">
<div id="toc"></div>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>