<ahref="global.html#Phaser.Path#numPointsreturn%257Bnumber%257DThetotalnumberofPathPointsinthisPath.">Phaser.Path#numPoints
return {number} The total number of PathPoints in this Path.</a>
<p>A constant used for the sortDirection value.<br>Use this if your game world is narrow but tall and scrolls from the bottom to the top (i.e. Commando or a vertically scrolling shoot-em-up)</p>
<p>A constant used for the sortDirection value.<br>Use this if your game world is wide but short and scrolls from the left to the right (i.e. Mario)</p>
<p>A constant used for the sortDirection value.<br>Use this if your game world is wide but short and scrolls from the right to the left (i.e. Mario backwards)</p>
<p>A constant used for the sortDirection value.<br>Use this if you don't wish to perform any pre-collision sorting at all, or will manually sort your Groups.</p>
<p>A constant used for the sortDirection value.<br>Use this if your game world is narrow but tall and scrolls from the top to the bottom (i.e. Dig Dug)</p>
<p>Set the checkCollision properties to control for which bounds collision is processed.<br>For example checkCollision.down = false means Bodies cannot collide with the World.bounds.bottom. An object containing allowed collision flags.</p>
<p>If <code>true</code> the <code>Body.preUpdate</code> method will be skipped, halting all motion for all bodies. Note that other methods such as <code>collide</code> will still work, so be careful not to call them on paused bodies.</p>
<p>If true the QuadTree will not be used for any collision. QuadTrees are great if objects are well spread out in your game, otherwise they are a performance hit. If you enable this you can disable on a per body basis via <code>Body.skipQuadTree</code>.</p>
<p>Used when colliding a Sprite vs. a Group, or a Group vs. a Group, this defines the direction the sort is based on. Default is Phaser.Physics.Arcade.LEFT_RIGHT.</p>
<p>Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.)<br>You must give a maximum speed value, beyond which the display object won't go any faster.<br>Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.<br>Note: The display object doesn't stop moving once it reaches the destination coordinates.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move.</p></td>
</tr>
<tr>
<tdclass="name"><code>destination</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move towards. Can be any object but must have visible x/y properties.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will accelerate in pixels per second.</p></td>
</tr>
<tr>
<tdclass="name"><code>xSpeedMax</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
500
</td>
<tdclass="description last"><p>The maximum x velocity the display object can reach.</p></td>
</tr>
<tr>
<tdclass="name"><code>ySpeedMax</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
500
</td>
<tdclass="description last"><p>The maximum y velocity the display object can reach.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle (in radians) that the object should be visually set to in order to match its new trajectory.</p>
<p>Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.)<br>You must give a maximum speed value, beyond which the display object won't go any faster.<br>Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.<br>Note: The display object doesn't stop moving once it reaches the destination coordinates.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move.</p></td>
id="accelerateToXY"><spanclass="type-signature"></span>accelerateToXY<spanclass="signature">(displayObject, x, y, <spanclass="optional">speed</span>, <spanclass="optional">xSpeedMax</span>, <spanclass="optional">ySpeedMax</span>)</span><spanclass="type-signature">→ {number}</span></h4>
</dt>
<dd>
<divclass="description">
<p>Sets the acceleration.x/y property on the display object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.)<br>You must give a maximum speed value, beyond which the display object won't go any faster.<br>Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.<br>Note: The display object doesn't stop moving once it reaches the destination coordinates.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move.</p></td>
</tr>
<tr>
<tdclass="name"><code>x</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The x coordinate to accelerate towards.</p></td>
</tr>
<tr>
<tdclass="name"><code>y</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The y coordinate to accelerate towards.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will accelerate in pixels per second.</p></td>
</tr>
<tr>
<tdclass="name"><code>xSpeedMax</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
500
</td>
<tdclass="description last"><p>The maximum x velocity the display object can reach.</p></td>
</tr>
<tr>
<tdclass="name"><code>ySpeedMax</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
500
</td>
<tdclass="description last"><p>The maximum y velocity the display object can reach.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle (in radians) that the object should be visually set to in order to match its new trajectory.</p>
<p>Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object.<br>One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>rotation</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The angle in radians.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will move, in pixels per second sq.</p></td>
<p>The optional <code>world</code> argument allows you to return the result based on the Game Objects <code>world</code> property,<br>instead of its <code>x</code> and <code>y</code> values. This is useful of the object has been nested inside an offset Group,<br>or parent Game Object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>source</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test from.</p></td>
</tr>
<tr>
<tdclass="name"><code>target</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test to.</p></td>
</tr>
<tr>
<tdclass="name"><code>world</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>Calculate the angle using World coordinates (true), or Object coordinates (false, the default)</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle in radians between the source and target display objects.</p>
<p>The optional <code>world</code> argument allows you to return the result based on the Game Objects <code>world</code> property,<br>instead of its <code>x</code> and <code>y</code> values. This is useful of the object has been nested inside an offset Group,<br>or parent Game Object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test from.</p></td>
id="angleToXY"><spanclass="type-signature"></span>angleToXY<spanclass="signature">(displayObject, x, y, <spanclass="optional">world</span>)</span><spanclass="type-signature">→ {number}</span></h4>
<p>The optional <code>world</code> argument allows you to return the result based on the Game Objects <code>world</code> property,<br>instead of its <code>x</code> and <code>y</code> values. This is useful of the object has been nested inside an offset Group,<br>or parent Game Object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test from.</p></td>
</tr>
<tr>
<tdclass="name"><code>x</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The x coordinate to get the angle to.</p></td>
</tr>
<tr>
<tdclass="name"><code>y</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The y coordinate to get the angle to.</p></td>
</tr>
<tr>
<tdclass="name"><code>world</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>Calculate the angle using World coordinates (true), or Object coordinates (false, the default)</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle in radians between displayObject.x/y to Pointer.x/y</p>
<p>Checks for collision between two game objects. You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap Layer or Group vs. Tilemap Layer collisions.<br>Both the first and second parameter can be arrays of objects, of differing types.<br>If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter.<br>The objects are also automatically separated. If you don't require separation then use ArcadePhysics.overlap instead.<br>An optional processCallback can be provided. If given this function will be called when two sprites are found to be colliding. It is called before any separation takes place,<br>giving you the chance to perform additional checks. If the function returns true then the collision and separation is carried out. If it returns false it is skipped.<br>The collideCallback is an optional function that is only called if two sprites collide. If a processCallback has been set then it needs to return true for collideCallback to be called.<br>NOTE: This function is not recursive, and will not test against children of objects passed (i.e. Groups or Tilemaps within other Groups).</p>
<tdclass="description last"><p>The first object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.TilemapLayer.</p></td>
<tdclass="description last"><p>The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.TilemapLayer.</p></td>
</tr>
<tr>
<tdclass="name"><code>collideCallback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are colliding Group vs. Sprite, in which case Sprite will always be the first parameter.</p></td>
</tr>
<tr>
<tdclass="name"><code>processCallback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them, unless you are colliding Group vs. Sprite, in which case Sprite will always be the first parameter.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The context in which to run the callbacks.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">boolean</span>
-
</div>
<divclass="returns-desc param-desc">
<p>True if a collision occurred otherwise false.</p>
<p>A tween-like function that takes a starting velocity and some other factors and returns an altered velocity.<br>Based on a function in Flixel by @ADAMATOMIC</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>axis</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>0 for nothing, 1 for horizontal, 2 for vertical.</p></td>
<p>The optional <code>world</code> argument allows you to return the result based on the Game Objects <code>world</code> property,<br>instead of its <code>x</code> and <code>y</code> values. This is useful of the object has been nested inside an offset Group,<br>or parent Game Object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>source</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test from.</p></td>
</tr>
<tr>
<tdclass="name"><code>target</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test to.</p></td>
</tr>
<tr>
<tdclass="name"><code>world</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>Calculate the distance using World coordinates (true), or Object coordinates (false, the default)</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The distance between the source and target objects.</p>
<p>Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used.<br>The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed.<br>If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()</p>
<p>The optional <code>world</code> argument allows you to return the result based on the Game Objects <code>world</code> property,<br>instead of its <code>x</code> and <code>y</code> values. This is useful of the object has been nested inside an offset Group,<br>or parent Game Object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test from.</p></td>
id="distanceToXY"><spanclass="type-signature"></span>distanceToXY<spanclass="signature">(displayObject, x, y, <spanclass="optional">world</span>)</span><spanclass="type-signature">→ {number}</span></h4>
<p>Find the distance between a display object (like a Sprite) and the given x/y coordinates.<br>The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed.<br>If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()</p>
<p>The optional <code>world</code> argument allows you to return the result based on the Game Objects <code>world</code> property,<br>instead of its <code>x</code> and <code>y</code> values. This is useful of the object has been nested inside an offset Group,<br>or parent Game Object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The Display Object to test from.</p></td>
</tr>
<tr>
<tdclass="name"><code>x</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The x coordinate to move towards.</p></td>
</tr>
<tr>
<tdclass="name"><code>y</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The y coordinate to move towards.</p></td>
</tr>
<tr>
<tdclass="name"><code>world</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
false
</td>
<tdclass="description last"><p>Calculate the distance using World coordinates (true), or Object coordinates (false, the default)</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The distance between the object and the x/y coordinates.</p>
<p>This will create an Arcade Physics body on the given game object or array of game objects.<br>A game object can only have 1 physics body active at any one time, and it can't be changed until the object is destroyed.</p>
<tdclass="description last"><p>The game object to create the physics body on. Can also be an array or Group of objects, a body will be created on every child that has a <code>body</code> property.</p></td>
</tr>
<tr>
<tdclass="name"><code>children</code></td>
<tdclass="type">
<spanclass="param-type">boolean</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
true
</td>
<tdclass="description last"><p>Should a body be created on all children of this object? If true it will recurse down the display list as far as it can go.</p></td>
<p>When you add an Arcade Physics body to an object it will automatically add the object into its parent Groups hash array.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>object</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="description last"><p>The game object to create the physics body on. A body will only be created if this object has a null <code>body</code> property.</p></td>
id="getObjectsAtLocation"><spanclass="type-signature"></span>getObjectsAtLocation<spanclass="signature">(x, y, group, <spanclass="optional">callback</span>, <spanclass="optional">callbackContext</span>, <spanclass="optional">callbackArg</span>)</span><spanclass="type-signature">→ {Array.<<ahref="PIXI.DisplayObject.html">PIXI.DisplayObject</a>>}</span></h4>
</dt>
<dd>
<divclass="description">
<p>Given a Group and a location this will check to see which Group children overlap with the coordinates.<br>Each child will be sent to the given callback for further processing.<br>Note that the children are not checked for depth order, but simply if they overlap the coordinate or not.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>x</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>The x coordinate to check.</p></td>
</tr>
<tr>
<tdclass="name"><code>y</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>The y coordinate to check.</p></td>
<tdclass="description last"><p>The Group to check.</p></td>
</tr>
<tr>
<tdclass="name"><code>callback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>A callback function that is called if the object overlaps the coordinates. The callback will be sent two parameters: the callbackArg and the Object that overlapped the location.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>The context in which to run the callback.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackArg</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>An argument to pass to the callback.</p></td>
<p>Given a Group and a Pointer this will check to see which Group children overlap with the Pointer coordinates.<br>Each child will be sent to the given callback for further processing.<br>Note that the children are not checked for depth order, but simply if they overlap the Pointer or not.</p>
<tdclass="description last"><p>The Group to check.</p></td>
</tr>
<tr>
<tdclass="name"><code>callback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>A callback function that is called if the object overlaps with the Pointer. The callback will be sent two parameters: the Pointer and the Object that overlapped with it.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="description last"><p>The context in which to run the callback.</p></td>
<p>Calculates the horizontal overlap between two Bodies and sets their properties accordingly, including:<br><code>touching.left</code>, <code>touching.right</code> and <code>overlapX</code>.</p>
<p>Calculates the vertical overlap between two Bodies and sets their properties accordingly, including:<br><code>touching.up</code>, <code>touching.down</code> and <code>overlapY</code>.</p>
<p>Move the given display object towards the destination object at a steady velocity.<br>If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds.<br>Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.<br>Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.<br>Note: The display object doesn't stop moving once it reaches the destination coordinates.<br>Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move.</p></td>
</tr>
<tr>
<tdclass="name"><code>destination</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move towards. Can be any object but must have visible x/y properties.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will move, in pixels per second (default is 60 pixels/sec)</p></td>
</tr>
<tr>
<tdclass="name"><code>maxTime</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle (in radians) that the object should be visually set to in order to match its new velocity.</p>
<p>Move the given display object towards the pointer at a steady velocity. If no pointer is given it will use Phaser.Input.activePointer.<br>If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.<br>Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.<br>Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.<br>Note: The display object doesn't stop moving once it reaches the destination coordinates.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will move, in pixels per second (default is 60 pixels/sec)</p></td>
<tdclass="description last"><p>The pointer to move towards. Defaults to Phaser.Input.activePointer.</p></td>
</tr>
<tr>
<tdclass="name"><code>maxTime</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle (in radians) that the object should be visually set to in order to match its new velocity.</p>
id="moveToXY"><spanclass="type-signature"></span>moveToXY<spanclass="signature">(displayObject, x, y, <spanclass="optional">speed</span>, <spanclass="optional">maxTime</span>)</span><spanclass="type-signature">→ {number}</span></h4>
</dt>
<dd>
<divclass="description">
<p>Move the given display object towards the x/y coordinates at a steady velocity.<br>If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.<br>Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.<br>Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.<br>Note: The display object doesn't stop moving once it reaches the destination coordinates.<br>Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The display object to move.</p></td>
</tr>
<tr>
<tdclass="name"><code>x</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The x coordinate to move towards.</p></td>
</tr>
<tr>
<tdclass="name"><code>y</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The y coordinate to move towards.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will move, in pixels per second (default is 60 pixels/sec)</p></td>
</tr>
<tr>
<tdclass="name"><code>maxTime</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
0
</td>
<tdclass="description last"><p>Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">number</span>
-
</div>
<divclass="returns-desc param-desc">
<p>The angle (in radians) that the object should be visually set to in order to match its new velocity.</p>
<p>Checks for overlaps between two game objects. The objects can be Sprites, Groups or Emitters.<br>You can perform Sprite vs. Sprite, Sprite vs. Group and Group vs. Group overlap checks.<br>Unlike collide the objects are NOT automatically separated or have any physics applied, they merely test for overlap results.<br>Both the first and second parameter can be arrays of objects, of differing types.<br>If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter.<br>NOTE: This function is not recursive, and will not test against children of objects passed (i.e. Groups within Groups).</p>
<tdclass="description last"><p>The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter.</p></td>
</tr>
<tr>
<tdclass="name"><code>overlapCallback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter.</p></td>
</tr>
<tr>
<tdclass="name"><code>processCallback</code></td>
<tdclass="type">
<spanclass="param-type">function</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
null
</td>
<tdclass="description last"><p>A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then <code>overlapCallback</code> will only be called if this callback returns <code>true</code>.</p></td>
</tr>
<tr>
<tdclass="name"><code>callbackContext</code></td>
<tdclass="type">
<spanclass="param-type">object</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The context in which to run the callbacks.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<divclass="returns">
<divclass="returns-type">
<spanclass="param-type">boolean</span>
-
</div>
<divclass="returns-desc param-desc">
<p>True if an overlap occurred otherwise false.</p>
<p>Called automatically by a Physics body, it updates all motion related values on the Body unless <code>World.isPaused</code> is <code>true</code>.</p>
<p>Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object.<br>One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>angle</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative)</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will move, in pixels per second sq.</p></td>
<p>Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object.<br>One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>rotation</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
</td>
<tdclass="default">
</td>
<tdclass="description last"><p>The angle in radians.</p></td>
</tr>
<tr>
<tdclass="name"><code>speed</code></td>
<tdclass="type">
<spanclass="param-type">number</span>
</td>
<tdclass="attributes">
<optional><br>
</td>
<tdclass="default">
60
</td>
<tdclass="description last"><p>The speed it will move, in pixels per second sq.</p></td>
<p>Find the angle in radians between a display object (like a Sprite) and a Pointer,<br>taking their x/y and center into account relative to the world.</p>
</div>
<h5>Parameters:</h5>
<tableclass="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<thclass="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<tdclass="name"><code>displayObject</code></td>
<tdclass="type">
<spanclass="param-type">any</span>
</td>
<tdclass="attributes">
</td>
<tdclass="description last"><p>The DisplayObjerct to test from.</p></td>