diff --git a/v3/src/gameobjects/components/GetBounds.js b/v3/src/gameobjects/components/GetBounds.js index 218413290..ba6eaba90 100644 --- a/v3/src/gameobjects/components/GetBounds.js +++ b/v3/src/gameobjects/components/GetBounds.js @@ -4,6 +4,16 @@ var Vector2 = require('../../math/Vector2'); var GetBounds = { + getCenter: function (output) + { + if (output === undefined) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); + + return output; + }, + getTopLeft: function (output) { if (output === undefined) { output = new Vector2(); }