Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world.

After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required.
Debug.renderPhysicsBody updated to take camera location and body rotation into account.
Body movement functions put back to velocity :)
Updated to latest dev version of pixi and latest p2.js
Updated docs
This commit is contained in:
photonstorm
2014-02-18 03:01:51 +00:00
parent 375e9e379a
commit 5d5c64d22f
201 changed files with 41296 additions and 47048 deletions
+363 -384
View File
@@ -58,6 +58,10 @@
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapFont.html">BitmapFont</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
@@ -90,10 +94,6 @@
<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>
@@ -142,6 +142,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
@@ -250,10 +254,6 @@
<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>
@@ -314,6 +314,10 @@
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
@@ -412,6 +416,10 @@
<a href="global.html#canUseNewCanvasBlendModes">canUseNewCanvasBlendModes</a>
</li>
<li>
<a href="global.html#getBounds">getBounds</a>
</li>
<li>
<a href="global.html#getNextPowerOfTwo">getNextPowerOfTwo</a>
</li>
@@ -603,7 +611,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-17">line 17</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-18">line 18</a>
</li></ul></dd>
@@ -632,6 +640,12 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>PIXI.Stage</li>
</ul>
@@ -646,108 +660,6 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dl>
<dt>
<h4 class="name" id="aspectRatio"><span class="type-signature"></span>aspectRatio<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>aspectRatio</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Aspect ratio.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-71">line 71</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="backgroundColor"><span class="type-signature"></span>backgroundColor<span class="type-signature"></span></h4>
@@ -836,109 +748,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-235">line 235</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="canvas"><span class="type-signature"></span>canvas<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>canvas</code></td>
<td class="type">
<span class="param-type">HTMLCanvasElement</span>
</td>
<td class="description last"><p>Reference to the newly created <code>canvas</code> element.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-38">line 38</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-299">line 299</a>
</li></ul></dd>
@@ -1046,7 +856,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-89">line 89</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-50">line 50</a>
</li></ul></dd>
@@ -1151,7 +961,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-77">line 77</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-44">line 44</a>
</li></ul></dd>
@@ -1169,7 +979,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt>
<h4 class="name" id="display"><span class="type-signature"></span>display<span class="type-signature"></span></h4>
<h4 class="name" id="exists"><span class="type-signature"></span>exists<span class="type-signature"></span></h4>
</dt>
@@ -1208,13 +1018,13 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<tr>
<td class="name"><code>display</code></td>
<td class="name"><code>exists</code></td>
<td class="type">
<span class="param-type">PIXI.Stage</span>
<span class="param-type">boolean</span>
@@ -1224,7 +1034,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<td class="description last"><p>The Pixi Stage which is hooked to the renderer.</p></td>
<td class="description last"><p>If exists is true the Stage and all children are updated, otherwise it is skipped.</p></td>
</tr>
@@ -1249,11 +1059,14 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<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="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-51">line 51</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-56">line 56</a>
</li></ul></dd>
@@ -1355,7 +1168,112 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-22">line 22</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-23">line 23</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>The name of this object.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy"><li>"_stage_root"</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-36">line 36</a>
</li></ul></dd>
@@ -1428,7 +1346,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<td class="description last"><p>Get the offset values (for input and other things).</p></td>
<td class="description last"><p>Holds the offset coordinates of the Game.canvas from the top-left of the browser window (used by Input and other classes)</p></td>
</tr>
@@ -1457,7 +1375,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-33">line 33</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-28">line 28</a>
</li></ul></dd>
@@ -1475,12 +1393,16 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt>
<h4 class="name" id="scale"><span class="type-signature"></span>scale<span class="type-signature"></span></h4>
<h4 class="name" id="setBackgroundColor"><span class="type-signature"></span>setBackgroundColor<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Sets the background color for the stage.</p>
</div>
@@ -1488,58 +1410,6 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<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.StageScaleMode.html">Phaser.StageScaleMode</a></span>
</td>
<td class="description last"><p>The scale of the current running game.</p></td>
</tr>
</tbody>
</table>
</dl>
@@ -1559,109 +1429,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-66">line 66</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="scaleMode"><span class="type-signature"></span>scaleMode<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>scaleMode</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The current scaleMode.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-56">line 56</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-284">line 284</a>
</li></ul></dd>
@@ -1726,7 +1494,218 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-105">line 105</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-160">line 160</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="postUpdate"><span class="type-signature"></span>postUpdate<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>This is called automatically before the renderer runs and after the plugins have updated.
In postUpdate this is where all the final physics calculatations and object positioning happens.
The objects are processed in the order of the display list.
The only exception to this is if the camera is following an object, in which case that is updated first.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-120">line 120</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="preUpdate"><span class="type-signature"></span>preUpdate<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>This is called automatically after the plugins preUpdate and before the State.update.
Most objects have preUpdate methods and it's where initial movement and positioning is done.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-85">line 85</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>This is called automatically after the State.update, but before particles or plugins update.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-104">line 104</a>
</li></ul></dd>
@@ -1795,7 +1774,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-190">line 190</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-243">line 243</a>
</li></ul></dd>
@@ -1913,7 +1892,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-208">line 208</a>
<a href="Stage.js.html">core/Stage.js</a>, <a href="Stage.js.html#sunlight-1-line-261">line 261</a>
</li></ul></dd>
@@ -1964,7 +1943,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
<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:51 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Tue Feb 18 2014 03:01:26 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>