mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Added getCenter to the Bounds component
This commit is contained in:
parent
1ba75cd50c
commit
795a2fa2ed
1 changed files with 10 additions and 0 deletions
|
@ -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(); }
|
||||
|
|
Loading…
Reference in a new issue