Updated docs for 1.1.2 release.

This commit is contained in:
photonstorm
2013-11-01 18:16:52 +00:00
parent eb95ce231b
commit 3e9777e6f4
150 changed files with 6188 additions and 2252 deletions
+25 -24
View File
@@ -58,10 +58,6 @@
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Bullet.html">Bullet</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
@@ -487,6 +483,11 @@ Phaser.Physics.Arcade.Body = function (sprite) {
*/
this.halfHeight = Math.floor(sprite.currentFrame.sourceSizeH / 2);
/**
* @property {Phaser.Point} center - The center coordinate of the Physics Body.
*/
this.center = new Phaser.Point(this.x + this.halfWidth, this.y + this.halfHeight);
/**
* @property {number} _sx - Internal cache var.
* @private
@@ -706,6 +707,7 @@ Phaser.Physics.Arcade.Body.prototype = {
this.halfHeight = Math.floor(this.height / 2);
this._sx = scaleX;
this._sy = scaleY;
this.center.setTo(this.x + this.halfWidth, this.y + this.halfHeight);
}
},
@@ -736,8 +738,8 @@ Phaser.Physics.Arcade.Body.prototype = {
this.screenX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.screenY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preX = (this.sprite.world.x - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preRotation = this.sprite.angle;
@@ -754,7 +756,8 @@ Phaser.Physics.Arcade.Body.prototype = {
this.checkWorldBounds();
}
this.updateHulls();Array }
this.updateHulls();
}
if (this.skipQuadTree == false && this.allowCollision.none == false && this.sprite.visible && this.sprite.alive)
{
@@ -773,16 +776,6 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
postUpdate: function () {
// Calculate forward-facing edge
if (this.deltaX() == 0 && this.deltaY() == 0)
{
// Can't work it out from the Body, how about from x position?
if (this.sprite.deltaX() == 0 && this.sprite.deltaY() == 0)
{
// still as a statue
}
}
if (this.deltaX() &lt; 0)
{
this.facing = Phaser.LEFT;
@@ -801,8 +794,12 @@ Phaser.Physics.Arcade.Body.prototype = {
this.facing = Phaser.DOWN;
}
this.sprite.x += this.deltaX();
this.sprite.y += this.deltaY();
if (this.deltaX() !== 0 || this.deltaY() !== 0)
{
this.sprite.x += this.deltaX();
this.sprite.y += this.deltaY();
this.center.setTo(this.x + this.halfWidth, this.y + this.halfHeight);
}
if (this.allowRotation)
{
@@ -880,6 +877,8 @@ Phaser.Physics.Arcade.Body.prototype = {
this.halfHeight = Math.floor(this.height / 2);
this.offset.setTo(offsetX, offsetY);
this.center.setTo(this.x + this.halfWidth, this.y + this.halfHeight);
},
/**
@@ -894,13 +893,15 @@ Phaser.Physics.Arcade.Body.prototype = {
this.angularVelocity = 0;
this.angularAcceleration = 0;
this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preX = (this.sprite.world.x - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preRotation = this.sprite.angle;
this.x = this.preX;
this.y = this.preY;
this.rotation = this.preRotation;
this.center.setTo(this.x + this.halfWidth, this.y + this.halfHeight);
},
@@ -925,7 +926,7 @@ Phaser.Physics.Arcade.Body.prototype = {
},
/**
* Returns the delta x value.
* Returns the delta x value. The difference between Body.x now and in the previous step.
*
* @method Phaser.Physics.Arcade.Body#deltaX
* @return {number} The delta value.
@@ -935,7 +936,7 @@ Phaser.Physics.Arcade.Body.prototype = {
},
/**
* Returns the delta y value.
* Returns the delta y value. The difference between Body.y now and in the previous step.
*
* @method Phaser.Physics.Arcade.Body#deltaY
* @return {number} The delta value.
@@ -1042,7 +1043,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", {
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Fri Nov 01 2013 18:16:08 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>