mirror of
https://github.com/photonstorm/phaser
synced 2025-02-26 04:17:08 +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 = {
|
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)
|
getTopLeft: function (output)
|
||||||
{
|
{
|
||||||
if (output === undefined) { output = new Vector2(); }
|
if (output === undefined) { output = new Vector2(); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue