mirror of
https://github.com/photonstorm/phaser
synced 2025-02-26 04:17:08 +00:00
When enabling a Game Object for Input Debugging the created debug shape will now factor in the position, scale and rotation of the Game Objects parent Container, if it has one. #4998
This commit is contained in:
parent
397944181e
commit
2c80fad116
1 changed files with 21 additions and 3 deletions
|
@ -2462,9 +2462,27 @@ var InputPlugin = new Class({
|
||||||
debug.setStrokeStyle(1 / gameObject.scale, color);
|
debug.setStrokeStyle(1 / gameObject.scale, color);
|
||||||
|
|
||||||
debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY);
|
debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY);
|
||||||
debug.setRotation(gameObject.rotation);
|
|
||||||
debug.setScale(gameObject.scaleX, gameObject.scaleY);
|
var x = gameObject.x;
|
||||||
debug.setPosition(gameObject.getWorldTransformMatrix().tx + offsetx, gameObject.getWorldTransformMatrix().ty + offsety);
|
var y = gameObject.y;
|
||||||
|
var rotation = gameObject.rotation;
|
||||||
|
var scaleX = gameObject.scaleX;
|
||||||
|
var scaleY = gameObject.scaleY;
|
||||||
|
|
||||||
|
if (gameObject.parentContainer)
|
||||||
|
{
|
||||||
|
var matrix = gameObject.getWorldTransformMatrix();
|
||||||
|
|
||||||
|
x = matrix.tx;
|
||||||
|
y = matrix.ty;
|
||||||
|
rotation = matrix.rotation;
|
||||||
|
scaleX = matrix.scaleX;
|
||||||
|
scaleY = matrix.scaleY;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug.setRotation(rotation);
|
||||||
|
debug.setScale(scaleX, scaleY);
|
||||||
|
debug.setPosition(x + offsetx, y + offsety);
|
||||||
debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY);
|
debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY);
|
||||||
debug.setDepth(gameObject.depth);
|
debug.setDepth(gameObject.depth);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue