mirror of
https://github.com/wassname/phaser.git
synced 2026-08-14 12:40:17 +08:00
Fixed anchor issue with Sprite.body.
This commit is contained in:
+5
-2
@@ -123,9 +123,12 @@ Phaser.Stage.prototype.postUpdate = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
while(i-- && this.children[i] !== this.game.world.camera.target)
|
||||
while(i--)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
if (this.children[i] !== this.game.world.camera.target)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+5
-4
@@ -632,12 +632,13 @@ Phaser.Physics.Body.prototype = {
|
||||
|
||||
if (typeof sprite === 'undefined') { sprite = this.sprite; }
|
||||
|
||||
var px = (sprite.width / 2) + (-sprite.width * sprite.anchor.x);
|
||||
var py = (sprite.height / 2) + (-sprite.height * sprite.anchor.y);
|
||||
|
||||
// because Sprite.phyicsEnabled = true now sets anchor to 0.5
|
||||
// var px = (sprite.width / 2) + (-sprite.width * sprite.anchor.x);
|
||||
// var py = (sprite.height / 2) + (-sprite.height * sprite.anchor.y);
|
||||
|
||||
this.clearShapes();
|
||||
|
||||
return this.addRectangle(sprite.width, sprite.height, px, py, sprite.rotation);
|
||||
return this.addRectangle(sprite.width, sprite.height, 0, 0, sprite.rotation);
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user