phaser/docs/Phaser.Cache.html

6861 lines
85 KiB
HTML
Raw Normal View History

2013-10-02 14:05:55 +00:00
<!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
2013-10-02 14:05:55 +00:00
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
2013-10-02 14:05:55 +00:00
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
2013-10-02 14:05:55 +00:00
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
2013-10-02 14:05:55 +00:00
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
2013-10-02 14:05:55 +00:00
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
2013-10-02 14:05:55 +00:00
</li>
2013-10-03 00:21:08 +00:00
<li>
<a href="Phaser.Color.html">Color</a>
2013-10-03 00:21:08 +00:00
</li>
2013-10-02 14:05:55 +00:00
<li>
<a href="Phaser.Device.html">Device</a>
2013-10-02 14:05:55 +00:00
</li>
2013-10-03 00:21:08 +00:00
<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.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
2013-10-03 00:21:08 +00:00
</li>
2013-10-02 14:05:55 +00:00
<li>
<a href="Phaser.Game.html">Game</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.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 19:18:24 +00:00
<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>
2013-10-02 14:05:55 +00:00
<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.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
2013-10-03 00:21:08 +00:00
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
2013-10-02 14:05:55 +00:00
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
2013-10-03 00:21:08 +00:00
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
2013-10-02 14:05:55 +00:00
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
2013-10-03 00:21:08 +00:00
<li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a>
</li>
2013-10-02 14:05:55 +00:00
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
2013-10-02 14:05:55 +00:00
<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>
2013-10-02 14:05:55 +00:00
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#HEXtoRGB">HEXtoRGB</a>
</li>
</ul>
</li>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
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. Cache 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-16">line 16</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-21">line 21</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>Description.</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-70">line 70</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<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-199">line 199</a>
2013-10-02 14:05:55 +00:00
</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-76">line 76</a>
2013-10-02 14:05:55 +00:00
</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 when a key is wrong / missing. 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-220">line 220</a>
2013-10-02 14:05:55 +00:00
</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-255">line 255</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addRenderTexture"><span class="type-signature"></span>addRenderTexture<span class="signature">(key, textue)</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>textue</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-89">line 89</a>
2013-10-02 14:05:55 +00:00
</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-273">line 273</a>
2013-10-02 14:05:55 +00:00
</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, frameMax)</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 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 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="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="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="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="description last"><p>How many frames stored in the sprite sheet.</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-104">line 104</a>
2013-10-02 14:05:55 +00:00
</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-238">line 238</a>
2013-10-02 14:05:55 +00:00
</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-167">line 167</a>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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.</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-150">line 150</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addTileset"><span class="type-signature"></span>addTileset<span class="signature">(key, url, data, tileWidth, tileHeight, tileMax, <span class="optional">tileMargin</span>, <span class="optional">tileSpacing</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Add a new tile set 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 tile set file.</p></td>
</tr>
2013-10-02 14:05:55 +00:00
<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 tile set data.</p></td>
</tr>
<tr>
<td class="name"><code>tileWidth</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>tileHeight</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>tileMax</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
2013-10-02 14:05:55 +00:00
<td class="attributes">
2013-10-02 14:05:55 +00:00
2013-10-02 14:05:55 +00:00
</td>
2013-10-02 14:05:55 +00:00
<td class="default">
</td>
2013-10-02 14:05:55 +00:00
<td class="description last"><p>How many tiles stored in the sprite sheet.</p></td>
2013-10-02 14:05:55 +00:00
</tr>
<tr>
<td class="name"><code>tileMargin</code></td>
2013-10-02 14:05:55 +00:00
<td class="type">
<span class="param-type">number</span>
2013-10-02 14:05:55 +00:00
</td>
<td class="attributes">
&lt;optional><br>
</td>
2013-10-02 14:05:55 +00:00
<td class="default">
0
</td>
2013-10-02 14:05:55 +00:00
<td class="description last"><p>If the tiles have been drawn with a margin, specify the amount here.</p></td>
2013-10-02 14:05:55 +00:00
</tr>
<tr>
<td class="name"><code>tileSpacing</code></td>
2013-10-02 14:05:55 +00:00
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
2013-10-02 14:05:55 +00:00
</td>
2013-10-02 14:05:55 +00:00
<td class="default">
0
</td>
<td class="description last"><p>If the tiles have been drawn with spacing between them, specify the amount here.</p></td>
2013-10-02 14:05:55 +00:00
</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-126">line 126</a>
2013-10-02 14:05:55 +00:00
</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 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-382">line 382</a>
2013-10-02 14:05:55 +00:00
</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-350">line 350</a>
2013-10-02 14:05:55 +00:00
</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-768">line 768</a>
2013-10-02 14:05:55 +00:00
</li></ul></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 acanvas 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 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-365">line 365</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The canvas you want.</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>
2013-10-02 14:05:55 +00:00
</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 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-521">line 521</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data you want.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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 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-487">line 487</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data you want.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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 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-504">line 504</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data you want.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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 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-470">line 470</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data you want.</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 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-400">line 400</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The image data you want.</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; {Array}</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-698">line 698</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The string based keys in the Cache.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
2013-10-02 14:05:55 +00:00
</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; {Array}</span></h4>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
<td class="type">
<span class="param-type">Array</span>
2013-10-02 14:05:55 +00:00
</td>
<td class="description last"><p>An array of items to return the keys for.</p></td>
2013-10-02 14:05:55 +00:00
</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-674">line 674</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The array of item keys.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get sound by key.</p>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
</tr>
</tbody>
</table>
2013-10-02 14:05:55 +00:00
<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-573">line 573</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The sound you want.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Sound.html">Phaser.Sound</a></span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get sound data by key.</p>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
<td class="type">
<span class="param-type">string</span>
2013-10-02 14:05:55 +00:00
</td>
<td class="description last"><p>Asset key of the sound you want.</p></td>
2013-10-02 14:05:55 +00:00
</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-591">line 591</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The sound data you want.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
2013-10-02 14:05:55 +00:00
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getSoundKeys"><span class="type-signature"></span>getSoundKeys<span class="signature">()</span><span class="type-signature"> &rarr; {Array}</span></h4>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Returns an array containing all of the keys of Sounds in the Cache.</p>
2013-10-02 14:05:55 +00:00
</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-708">line 708</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The string based keys in the Cache.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get text data by key.</p>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
2013-10-02 14:05:55 +00:00
</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-656">line 656</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The text data you want.</p>
2013-10-02 14:05:55 +00:00
</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; {Array}</span></h4>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Returns an array containing all of the keys of Text Files in the Cache.</p>
2013-10-02 14:05:55 +00:00
</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-718">line 718</a>
2013-10-02 14:05:55 +00:00
</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">Array</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; {Phaser.RenderTexture}</span></h4>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get a RenderTexture by key.</p>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
2013-10-02 14:05:55 +00:00
</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-555">line 555</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The RenderTexture you want.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Phaser.RenderTexture</span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
</tr>
</tbody>
</table>
2013-10-02 14:05:55 +00:00
<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-538">line 538</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The frame data you want.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Frame.html">Phaser.Frame</a></span>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get tilemap data by key.</p>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The tilemap data. The tileset image is in the data property, the map data in mapData.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
2013-10-02 14:05:55 +00:00
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getTileset"><span class="type-signature"></span>getTileset<span class="signature">(key)</span><span class="type-signature"> &rarr; {Phaser.Tileset}</span></h4>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get tile set image data by key.</p>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
2013-10-02 14:05:55 +00:00
</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>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The tileset data. The tileset image is in the data property, the tile data in tileData.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Phaser.Tileset</span>
2013-10-02 14:05:55 +00:00
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getTileSetImage"><span class="type-signature"></span>getTileSetImage<span class="signature">(key)</span><span class="type-signature"> &rarr; {object}</span></h4>
2013-10-02 14:05:55 +00:00
</dt>
<dd>
<div class="description">
<p>Get tile set image data by key.</p>
2013-10-02 14:05:55 +00:00
</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 you want.</p></td>
2013-10-02 14:05:55 +00:00
</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-417">line 417</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The image data you want.</p>
2013-10-02 14:05:55 +00:00
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
2013-10-02 14:05:55 +00:00
</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 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-609">line 609</a>
2013-10-02 14:05:55 +00:00
</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 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-625">line 625</a>
2013-10-02 14:05:55 +00:00
</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-638">line 638</a>
2013-10-02 14:05:55 +00:00
</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-300">line 300</a>
2013-10-02 14:05:55 +00:00
</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>Description.</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-321">line 321</a>
2013-10-02 14:05:55 +00:00
</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-728">line 728</a>
2013-10-02 14:05:55 +00:00
</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-738">line 738</a>
2013-10-02 14:05:55 +00:00
</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-748">line 748</a>
2013-10-02 14:05:55 +00:00
</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-758">line 758</a>
2013-10-02 14:05:55 +00:00
</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>Description.</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-336">line 336</a>
2013-10-02 14:05:55 +00:00
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2013 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a>
on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
2013-10-02 14:05:55 +00:00
</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>