phaser/docs/Phaser.Group.html

8800 lines
No EOL
123 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Class: Group</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.Image.html">Image</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>
<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#canUseNewCanvasBlendModes">canUseNewCanvasBlendModes</a>
</li>
<li>
<a href="global.html#getNextPowerOfTwo">getNextPowerOfTwo</a>
</li>
<li>
<a href="global.html#hex2rgb">hex2rgb</a>
</li>
<li>
<a href="global.html#hitTest">hitTest</a>
</li>
<li>
<a href="global.html#rgb2hex">rgb2hex</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<h1 class="page-title">Class: Group</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="Phaser.html">Phaser</a>.</span>
Group
</h2>
<div class="class-description"><p>A Group is a container for display objects that allows for fast pooling, recycling and collision checks.</p></div>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="Group"><span class="type-signature"></span>new Group<span class="signature">(game, parent, <span class="optional">name</span>, <span class="optional">useStage</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Phaser Group constructor.</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>game</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>A reference to the currently running game.</p></td>
</tr>
<tr>
<td class="name"><code>parent</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined or null it will use game.world.</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
group
</td>
<td class="description last"><p>A name for this Group. Not used internally but useful for debugging.</p></td>
</tr>
<tr>
<td class="name"><code>useStage</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Should this Group be added to the World (default, false) or direct to the Stage (true).</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-17">line 17</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<h4 class="name" id="RETURN_CHILD"><span class="type-signature">&lt;static, constant> </span>RETURN_CHILD<span class="type-signature"> :number</span></h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-114">line 114</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="RETURN_NONE"><span class="type-signature">&lt;static, constant> </span>RETURN_NONE<span class="type-signature"> :number</span></h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-102">line 102</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="RETURN_TOTAL"><span class="type-signature">&lt;static, constant> </span>RETURN_TOTAL<span class="type-signature"> :number</span></h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-108">line 108</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="SORT_ASCENDING"><span class="type-signature">&lt;static, constant> </span>SORT_ASCENDING<span class="type-signature"> :number</span></h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-120">line 120</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="SORT_DESCENDING"><span class="type-signature">&lt;static, constant> </span>SORT_DESCENDING<span class="type-signature"> :number</span></h4>
</dt>
<dd>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">number</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-126">line 126</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="alive"><span class="type-signature"></span>alive<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>alive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>The alive property is useful for Groups that are children of other Groups and need to be included/excluded in checks like forEachAlive.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy"><li>true</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-62">line 62</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="alpha"><span class="type-signature"></span>alpha<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>alpha</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The alpha value of the Group container.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1151">line 1151</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="angle"><span class="type-signature"></span>angle<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The angle of rotation of the Group container. This will adjust the Group container itself by modifying its rotation.
This will have no impact on the rotation value of its children, but it will update their worldTransform and on-screen position.</p>
</div>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>angle</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The angle of rotation given in degrees, where 0 degrees = to the right.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1123">line 1123</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="cursor"><span class="type-signature"></span>cursor<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The cursor is a simple way to iterate through the objects in a Group using the Group.next and Group.previous functions.
The cursor is set to the first child added to the Group and doesn't change unless you call next, previous or set it directly with Group.cursor.</p>
</div>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>cursor</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last"><p>The current display object that the Group cursor is pointing to.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-89">line 89</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="exists"><span class="type-signature"></span>exists<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>exists</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If exists is true the Group is updated, otherwise it is skipped.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy"><li>true</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-68">line 68</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="game"><span class="type-signature"></span>game<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>game</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>
</td>
<td class="description last"><p>A reference to the currently running Game.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-22">line 22</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="length"><span class="type-signature">&lt;readonly> </span>length<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>length</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The total number of children in this Group, regardless of their exists/alive status.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1108">line 1108</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="name"><span class="type-signature"></span>name<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>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>A name for this Group. Not used internally but useful for debugging.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-32">line 32</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="rotation"><span class="type-signature"></span>rotation<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The angle of rotation of the Group container. This will adjust the Group container itself by modifying its rotation.
This will have no impact on the rotation value of its children, but it will update their worldTransform and on-screen position.</p>
</div>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>rotation</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The angle of rotation given in radians.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1147">line 1147</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="scale"><span class="type-signature"></span>scale<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>scale</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>
</td>
<td class="description last"><p>The scale of the Group container.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-78">line 78</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="total"><span class="type-signature">&lt;readonly> </span>total<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>total</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The total number of children in this Group who have a state of exists = true.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1093">line 1093</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="type"><span class="type-signature">&lt;protected> </span>type<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>type</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Internal Phaser Type value.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-56">line 56</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="visible"><span class="type-signature"></span>visible<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>visible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>The visible state of the Group. Non-visible Groups and all of their children are not rendered.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1149">line 1149</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="x"><span class="type-signature"></span>x<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The x coordinate of the Group container. You can adjust the Group container itself by modifying its coordinates.
This will have no impact on the x/y coordinates of its children, but it will update their worldTransform and on-screen position.</p>
</div>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The x coordinate of the Group container.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1143">line 1143</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="y"><span class="type-signature"></span>y<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The y coordinate of the Group container. You can adjust the Group container itself by modifying its coordinates.
This will have no impact on the x/y coordinates of its children, but it will update their worldTransform and on-screen position.</p>
</div>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The y coordinate of the Group container.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1145">line 1145</a>
</li></ul></dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(child)</span><span class="type-signature"> &rarr; {*}</span></h4>
</dt>
<dd>
<div class="description">
<p>Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
The child is automatically added to the top of the Group, so renders on-top of everything else within the Group. If you need to control
that then see the addAt method.</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>child</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>An instance of Phaser.Sprite, Phaser.Button or any other display object..</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-130">line 130</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="Phaser.Group.html#create">Phaser.Group#create</a></li>
<li><a href="Phaser.Group.html#addAt">Phaser.Group#addAt</a></li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The child that was added to the Group.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addAll"><span class="type-signature"></span>addAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Adds the amount to the given property on all children in this Group.
Group.addAll('x', 10) will add 10 to the child.x value.</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>property</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The property to increment, for example 'body.velocity.x' or 'angle'.</p></td>
</tr>
<tr>
<td class="name"><code>amount</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The amount to increment the property by. If child.x = 10 then addAll('x', 40) would make child.x = 50.</p></td>
</tr>
<tr>
<td class="name"><code>checkAlive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is alive.</p></td>
</tr>
<tr>
<td class="name"><code>checkVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is visible.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-507">line 507</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addAt"><span class="type-signature"></span>addAt<span class="signature">(child, index)</span><span class="type-signature"> &rarr; {*}</span></h4>
</dt>
<dd>
<div class="description">
<p>Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
The child is added to the Group at the location specified by the index value, this allows you to control child ordering.</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>child</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>An instance of Phaser.Sprite, Phaser.Button or any other display object..</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The index within the Group to insert the child to.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-162">line 162</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The child that was added to the Group.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="bringToTop"><span class="type-signature"></span>bringToTop<span class="signature">(child)</span><span class="type-signature"> &rarr; {*}</span></h4>
</dt>
<dd>
<div class="description">
<p>Brings the given child to the top of this Group so it renders above all other children.</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>child</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The child to bring to the top of this Group.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-327">line 327</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The child that was moved.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="callAll"><span class="type-signature"></span>callAll<span class="signature">(method, <span class="optional">context</span>, parameter)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Calls a function on all of the children regardless if they are dead or alive (see callAllExists if you need control over that)
After the method parameter and context you can add as many extra parameters as you like, which will all be passed to the child.</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>method</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>A string containing the name of the function that will be called. The function must exist on the child.</p></td>
</tr>
<tr>
<td class="name"><code>context</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
null
</td>
<td class="description last"><p>A string containing the context under which the method will be executed. Set to null to default to the child.</p></td>
</tr>
<tr>
<td class="name"><code>parameter</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
&lt;repeatable><br>
</td>
<td class="default">
</td>
<td class="description last"><p>Additional parameters that will be passed to the method.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-647">line 647</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="callAllExists"><span class="type-signature"></span>callAllExists<span class="signature">(callback, existsValue, parameter)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Calls a function on all of the children that have exists=true in this Group.
After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The function that exists on the children that will be called.</p></td>
</tr>
<tr>
<td class="name"><code>existsValue</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Only children with exists=existsValue will be called.</p></td>
</tr>
<tr>
<td class="name"><code>parameter</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
&lt;repeatable><br>
</td>
<td class="description last"><p>Additional parameters that will be passed to the callback.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-571">line 571</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="callbackFromArray"><span class="type-signature">&lt;protected> </span>callbackFromArray<span class="signature">(child, callback, length)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Returns a reference to a function that exists on a child of the Group based on the given callback array.</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>child</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>The object to inspect.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last"><p>The array of function names.</p></td>
</tr>
<tr>
<td class="name"><code>length</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The size of the array (pre-calculated in callAll).</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-594">line 594</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="countDead"><span class="type-signature"></span>countDead<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>
</dt>
<dd>
<div class="description">
<p>Call this function to find out how many members of the group are dead.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-926">line 926</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The number of children flagged as dead.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="countLiving"><span class="type-signature"></span>countLiving<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>
</dt>
<dd>
<div class="description">
<p>Call this function to find out how many members of the group are alive.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-914">line 914</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The number of children flagged as alive.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">(x, y, key, <span class="optional">frame</span>, <span class="optional">exists</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.Sprite.html">Phaser.Sprite</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Automatically creates a new Phaser.Sprite object and adds it to the top of this Group.
Useful if you don't need to create the Sprite instances before-hand.</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>x</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>The x coordinate to display the newly created Sprite at. The value is in relation to the Group.x point.</p></td>
</tr>
<tr>
<td class="name"><code>y</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>The y coordinate to display the newly created Sprite at. The value is in relation to the Group.y point.</p></td>
</tr>
<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 Game.cache key of the image that this Sprite will use.</p></td>
</tr>
<tr>
<td class="name"><code>frame</code></td>
<td class="type">
<span class="param-type">number</span>
|
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>If the Sprite image contains multiple frames you can specify which one to use here.</p></td>
</tr>
<tr>
<td class="name"><code>exists</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last"><p>The default exists state of the Sprite.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-205">line 205</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The child that was created.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="createMultiple"><span class="type-signature"></span>createMultiple<span class="signature">(quantity, key, <span class="optional">frame</span>, <span class="optional">exists</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Automatically creates multiple Phaser.Sprite objects and adds them to the top of this Group.
Useful if you need to quickly generate a pool of identical sprites, such as bullets. By default the sprites will be set to not exist
and will be positioned at 0, 0 (relative to the Group.x/y)</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>quantity</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>The number of Sprites to create.</p></td>
</tr>
<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 Game.cache key of the image that this Sprite will use.</p></td>
</tr>
<tr>
<td class="name"><code>frame</code></td>
<td class="type">
<span class="param-type">number</span>
|
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>If the Sprite image contains multiple frames you can specify which one to use here.</p></td>
</tr>
<tr>
<td class="name"><code>exists</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>The default exists state of the Sprite.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-243">line 243</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">(<span class="optional">destroyChildren</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Destroys this Group. Removes all children, then removes the container from the display list and nulls references.</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>destroyChildren</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Should every child of this Group have its destroy method called?</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1054">line 1054</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="divideAll"><span class="type-signature"></span>divideAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Divides the given property by the amount on all children in this Group.
Group.divideAll('x', 2) will half the child.x value.</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>property</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The property to divide, for example 'body.velocity.x' or 'angle'.</p></td>
</tr>
<tr>
<td class="name"><code>amount</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The amount to divide the property by. If child.x = 100 then divideAll('x', 2) would make child.x = 50.</p></td>
</tr>
<tr>
<td class="name"><code>checkAlive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is alive.</p></td>
</tr>
<tr>
<td class="name"><code>checkVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is visible.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-555">line 555</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback, callbackContext, checkExists)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run.
After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child.
For example: Group.forEach(awardBonusGold, this, true, 100, 500)
Note: Currently this will skip any children which are Groups themselves.</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>The function that will be called. Each child of the Group will be passed to it as its first parameter.</p></td>
</tr>
<tr>
<td class="name"><code>callbackContext</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The context in which the function should be called (usually 'this').</p></td>
</tr>
<tr>
<td class="name"><code>checkExists</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If set only children with exists=true will be passed to the callback, otherwise all children will be passed.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-707">line 707</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="forEachAlive"><span class="type-signature"></span>forEachAlive<span class="signature">(callback, callbackContext)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run.
You can add as many parameters as you like, which will all be passed to the callback along with the child.
For example: Group.forEachAlive(causeDamage, this, 500)</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>The function that will be called. Each child of the Group will be passed to it as its first parameter.</p></td>
</tr>
<tr>
<td class="name"><code>callbackContext</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The context in which the function should be called (usually 'this').</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-739">line 739</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="forEachAlive"><span class="type-signature"></span>forEachAlive<span class="signature">(callback, callbackContext)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run.
You can add as many parameters as you like, which will all be passed to the callback along with the child.
For example: Group.forEachAlive(causeDamage, this, 500)</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>The function that will be called. Each child of the Group will be passed to it as its first parameter.</p></td>
</tr>
<tr>
<td class="name"><code>callbackContext</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The context in which the function should be called (usually 'this').</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-757">line 757</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="forEachDead"><span class="type-signature"></span>forEachDead<span class="signature">(callback, callbackContext)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run.
You can add as many parameters as you like, which will all be passed to the callback along with the child.
For example: Group.forEachDead(bringToLife, this)</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>The function that will be called. Each child of the Group will be passed to it as its first parameter.</p></td>
</tr>
<tr>
<td class="name"><code>callbackContext</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The context in which the function should be called (usually 'this').</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-775">line 775</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getAt"><span class="type-signature"></span>getAt<span class="signature">(index)</span><span class="type-signature"> &rarr; {*}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns the child found at the given index within this Group.</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>index</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The index to return the child from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-192">line 192</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The child that was found at the given index.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFirstAlive"><span class="type-signature"></span>getFirstAlive<span class="signature">()</span><span class="type-signature"> &rarr; {Any}</span></h4>
</dt>
<dd>
<div class="description">
<p>Call this function to retrieve the first object with alive === true in the group.
This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-888">line 888</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The first alive child, or null if none found.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Any</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFirstDead"><span class="type-signature"></span>getFirstDead<span class="signature">()</span><span class="type-signature"> &rarr; {Any}</span></h4>
</dt>
<dd>
<div class="description">
<p>Call this function to retrieve the first object with alive === false in the group.
This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-901">line 901</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The first dead child, or null if none found.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Any</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFirstExists"><span class="type-signature"></span>getFirstExists<span class="signature">(state)</span><span class="type-signature"> &rarr; {Any}</span></h4>
</dt>
<dd>
<div class="description">
<p>Call this function to retrieve the first object with exists == (the given state) in the Group.</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>state</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>True or false.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-870">line 870</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The first child, or null if none found.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Any</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getIndex"><span class="type-signature"></span>getIndex<span class="signature">(child)</span><span class="type-signature"> &rarr; {number}</span></h4>
</dt>
<dd>
<div class="description">
<p>Get the index position of the given child in this Group.</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>child</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The child to get the index 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="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-346">line 346</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The index of the child or -1 if it's not a member of this Group.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getRandom"><span class="type-signature"></span>getRandom<span class="signature">(startIndex, length)</span><span class="type-signature"> &rarr; {Any}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns a member at random from the group.</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>startIndex</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Optional offset off the front of the array. Default value is 0, or the beginning of the array.</p></td>
</tr>
<tr>
<td class="name"><code>length</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Optional restriction on the number of values you want to randomly select from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-938">line 938</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A random child of this Group.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Any</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="iterate"><span class="type-signature"></span>iterate<span class="signature">(key, value, returnType, <span class="optional">callback</span>, <span class="optional">callbackContext</span>)</span><span class="type-signature"> &rarr; {any}</span></h4>
</dt>
<dd>
<div class="description">
<p>Iterates over the children of the Group. When a child has a property matching key that equals the given value, it is considered as a match.
Matched children can be sent to the optional callback, or simply returned or counted.
You can add as many callback parameters as you like, which will all be passed to the callback along with the child, after the callbackContext parameter.</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 child property to check, i.e. 'exists', 'alive', 'health'</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>If child.key === this value it will be considered a match. Note that a strict comparison is used.</p></td>
</tr>
<tr>
<td class="name"><code>returnType</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>How to return the data from this method. Either Phaser.Group.RETURN_NONE, Phaser.Group.RETURN_TOTAL or Phaser.Group.RETURN_CHILD.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
null
</td>
<td class="description last"><p>Optional function that will be called on each matching child. Each child of the Group will be passed to it as its first parameter.</p></td>
</tr>
<tr>
<td class="name"><code>callbackContext</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>The context in which the function should be called (usually 'this').</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-813">line 813</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns either a numeric total (if RETURN_TOTAL was specified) or the child object.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">any</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="multiplyAll"><span class="type-signature"></span>multiplyAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Multiplies the given property by the amount on all children in this Group.
Group.multiplyAll('x', 2) will x2 the child.x value.</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>property</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The property to multiply, for example 'body.velocity.x' or 'angle'.</p></td>
</tr>
<tr>
<td class="name"><code>amount</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The amount to multiply the property by. If child.x = 10 then multiplyAll('x', 2) would make child.x = 20.</p></td>
</tr>
<tr>
<td class="name"><code>checkAlive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is alive.</p></td>
</tr>
<tr>
<td class="name"><code>checkVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is visible.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-539">line 539</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Advances the Group cursor to the next object in the Group. If it's at the end of the Group it wraps around to the first object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-265">line 265</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="previous"><span class="type-signature"></span>previous<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Moves the Group cursor to the previous object in the Group. If it's at the start of the Group it wraps around to the last object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-289">line 289</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(child)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Removes the given child from this Group and sets its group property to null.</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>child</code></td>
<td class="type">
<span class="param-type">Any</span>
</td>
<td class="description last"><p>The child 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="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-960">line 960</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>true if the child was removed from this Group, otherwise false.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeAll"><span class="type-signature"></span>removeAll<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Removes all children from this Group, setting all group properties to null.
The Group container remains on the display list.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-990">line 990</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeBetween"><span class="type-signature"></span>removeBetween<span class="signature">(startIndex, endIndex)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Removes all children from this Group whos index falls beteen the given startIndex and endIndex values.</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>startIndex</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The index to start removing children from.</p></td>
</tr>
<tr>
<td class="name"><code>endIndex</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The index to stop removing children from. Must be higher than startIndex and less than the length of the Group.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-1018">line 1018</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="replace"><span class="type-signature"></span>replace<span class="signature">(oldChild, newChild)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group.</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>oldChild</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The child in this Group that will be replaced.</p></td>
</tr>
<tr>
<td class="name"><code>newChild</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The child to be inserted into this group.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-359">line 359</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(child, key, value, <span class="optional">checkAlive</span>, <span class="optional">checkVisible</span>, <span class="optional">operation</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>This function allows you to quickly set a property on a single child of this Group to a new value.
The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.</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>child</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The child to set the property on.</p></td>
</tr>
<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 property, as a string, to be set. For example: 'body.velocity.x'</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The value that will be set.</p></td>
</tr>
<tr>
<td class="name"><code>checkAlive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>If set then the child will only be updated if alive=true.</p></td>
</tr>
<tr>
<td class="name"><code>checkVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>If set then the child will only be updated if visible=true.</p></td>
</tr>
<tr>
<td class="name"><code>operation</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>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-451">line 451</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="setAll"><span class="type-signature"></span>setAll<span class="signature">(key, value, <span class="optional">checkAlive</span>, <span class="optional">checkVisible</span>, <span class="optional">operation</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>This function allows you to quickly set the same property across all children of this Group to a new value.
The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.</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 property, as a string, to be set. For example: 'body.velocity.x'</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The value that will be set.</p></td>
</tr>
<tr>
<td class="name"><code>checkAlive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>If set then only children with alive=true will be updated.</p></td>
</tr>
<tr>
<td class="name"><code>checkVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>If set then only children with visible=true will be updated.</p></td>
</tr>
<tr>
<td class="name"><code>operation</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>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-477">line 477</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="setProperty"><span class="type-signature"></span>setProperty<span class="signature">(child, key, value, <span class="optional">operation</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Sets the given property to the given value on the child. The operation controls the assignment of the value.</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>child</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The child to set the property value on.</p></td>
</tr>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>An array of strings that make up the property that will be set.</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The value that will be set.</p></td>
</tr>
<tr>
<td class="name"><code>operation</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>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-391">line 391</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="sort"><span class="type-signature"></span>sort<span class="signature">(<span class="optional">index</span>, <span class="optional">order</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Call this function to sort the group according to a particular value and order.
For example to depth sort Sprites for Zelda-style game you might call <code>group.sort('y', Phaser.Group.SORT_ASCENDING)</code> at the bottom of your <code>State.update()</code>.</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>index</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
'y'
</td>
<td class="description last"><p>The <code>string</code> name of the property you want to sort on.</p></td>
</tr>
<tr>
<td class="name"><code>order</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
Phaser.Group.SORT_ASCENDING
</td>
<td class="description last"><p>The <code>Group</code> constant that defines the sort order. Possible values are Phaser.Group.SORT_ASCENDING and Phaser.Group.SORT_DESCENDING.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-793">line 793</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="subAll"><span class="type-signature"></span>subAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Subtracts the amount from the given property on all children in this Group.
Group.subAll('x', 10) will minus 10 from the child.x value.</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>property</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The property to decrement, for example 'body.velocity.x' or 'angle'.</p></td>
</tr>
<tr>
<td class="name"><code>amount</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The amount to subtract from the property. If child.x = 50 then subAll('x', 40) would make child.x = 10.</p></td>
</tr>
<tr>
<td class="name"><code>checkAlive</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is alive.</p></td>
</tr>
<tr>
<td class="name"><code>checkVisible</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true the property will only be changed if the child is visible.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-523">line 523</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="swap"><span class="type-signature"></span>swap<span class="signature">(child1, child2)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Swaps the position of two children in this Group. Both children must be in this Group.
You cannot swap a child with itself, or swap un-parented children, doing so will return false.</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>child1</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The first child to swap.</p></td>
</tr>
<tr>
<td class="name"><code>child2</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The second child to swap.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Group.js.html">core/Group.js</a>, <a href="Group.js.html#sunlight-1-line-313">line 313</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 Sat Feb 08 2014 07:19:46 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>