mirror of
https://github.com/wassname/phaser.git
synced 2026-07-12 00:50:45 +08:00
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:
+31
-21
@@ -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>
|
||||
@@ -658,7 +666,7 @@ Phaser.Pointer.prototype = {
|
||||
}
|
||||
|
||||
// Fix to stop rogue browser plugins from blocking the visibility state event
|
||||
if (this.game.stage.disableVisibilityChange === false && this.game.paused && this.game.stage.scale.incorrectOrientation === false)
|
||||
if (this.game.stage.disableVisibilityChange === false && this.game.paused && this.game.scale.incorrectOrientation === false)
|
||||
{
|
||||
this.game.paused = false;
|
||||
return this;
|
||||
@@ -676,12 +684,12 @@ Phaser.Pointer.prototype = {
|
||||
this._holdSent = false;
|
||||
|
||||
// This sets the x/y and other local values
|
||||
this.move(event);
|
||||
this.move(event, true);
|
||||
|
||||
// x and y are the old values here?
|
||||
this.positionDown.setTo(this.x, this.y);
|
||||
|
||||
if (this.game.input.multiInputOverride == Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride == Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride == Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers === 0))
|
||||
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers === 0))
|
||||
{
|
||||
this.game.input.x = this.x;
|
||||
this.game.input.y = this.y;
|
||||
@@ -693,7 +701,7 @@ Phaser.Pointer.prototype = {
|
||||
this._stateReset = false;
|
||||
this.totalTouches++;
|
||||
|
||||
if (this.isMouse === false)
|
||||
if (!this.isMouse)
|
||||
{
|
||||
this.game.input.currentPointers++;
|
||||
}
|
||||
@@ -748,14 +756,17 @@ Phaser.Pointer.prototype = {
|
||||
* Called when the Pointer is moved.
|
||||
* @method Phaser.Pointer#move
|
||||
* @param {MouseEvent|PointerEvent|TouchEvent} event - The event passed up from the input handler.
|
||||
* @param {boolean} [fromClick=false] - Was this called from the click event?
|
||||
*/
|
||||
move: function (event) {
|
||||
move: function (event, fromClick) {
|
||||
|
||||
if (this.game.input.pollLocked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof fromClick === 'undefined') { fromClick = false; }
|
||||
|
||||
if (typeof event.button !== 'undefined')
|
||||
{
|
||||
this.button = event.button;
|
||||
@@ -822,11 +833,10 @@ Phaser.Pointer.prototype = {
|
||||
do
|
||||
{
|
||||
// If the object is using pixelPerfect checks, or has a higher InputManager.PriorityID OR if the priority ID is the same as the current highest AND it has a higher renderOrderID, then set it to the top
|
||||
if (currentNode.pixelPerfect || currentNode.priorityID > this._highestInputPriorityID || (currentNode.priorityID == this._highestInputPriorityID && currentNode.sprite.renderOrderID > this._highestRenderOrderID))
|
||||
if (currentNode.pixelPerfectClick || currentNode.pixelPerfectOver || currentNode.priorityID > this._highestInputPriorityID || (currentNode.priorityID === this._highestInputPriorityID && currentNode.sprite.renderOrderID > this._highestRenderOrderID))
|
||||
{
|
||||
if (currentNode.checkPointerOver(this))
|
||||
if ((!fromClick && currentNode.checkPointerOver(this)) || (fromClick && currentNode.checkPointerDown(this)))
|
||||
{
|
||||
// console.log('HRO set', currentNode.sprite.name);
|
||||
this._highestRenderOrderID = currentNode.sprite.renderOrderID;
|
||||
this._highestInputPriorityID = currentNode.priorityID;
|
||||
this._highestRenderObject = currentNode;
|
||||
@@ -837,7 +847,7 @@ Phaser.Pointer.prototype = {
|
||||
while (currentNode != null)
|
||||
}
|
||||
|
||||
if (this._highestRenderObject == null)
|
||||
if (this._highestRenderObject === null)
|
||||
{
|
||||
// The pointer isn't currently over anything, check if we've got a lingering previous target
|
||||
if (this.targetObject)
|
||||
@@ -849,7 +859,7 @@ Phaser.Pointer.prototype = {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.targetObject == null)
|
||||
if (this.targetObject === null)
|
||||
{
|
||||
// And now set the new one
|
||||
// console.log('And now set the new one');
|
||||
@@ -860,7 +870,7 @@ Phaser.Pointer.prototype = {
|
||||
{
|
||||
// We've got a target from the last update
|
||||
// console.log("We've got a target from the last update");
|
||||
if (this.targetObject == this._highestRenderObject)
|
||||
if (this.targetObject === this._highestRenderObject)
|
||||
{
|
||||
// Same target as before, so update it
|
||||
// console.log("Same target as before, so update it");
|
||||
@@ -894,7 +904,7 @@ Phaser.Pointer.prototype = {
|
||||
leave: function (event) {
|
||||
|
||||
this.withinGame = false;
|
||||
this.move(event);
|
||||
this.move(event, false);
|
||||
|
||||
},
|
||||
|
||||
@@ -1114,7 +1124,7 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", {
|
||||
|
||||
<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:40 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Tue Feb 18 2014 03:01:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user