2018-02-12 16:01:20 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2020-01-15 12:07:09 +00:00
|
|
|
* @copyright 2020 Photon Storm Ltd.
|
2019-05-10 15:15:04 +00:00
|
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
2018-02-12 16:01:20 +00:00
|
|
|
*/
|
|
|
|
|
2017-10-13 13:11:54 +00:00
|
|
|
var Point = require('../point/Point');
|
|
|
|
|
2016-12-20 17:07:16 +00:00
|
|
|
|
2017-10-13 13:11:54 +00:00
|
|
|
/**
|
2020-02-04 16:19:42 +00:00
|
|
|
* Returns the size of the Rectangle, expressed as a Point object.
|
|
|
|
* With the value of the `width` as the `x` property and the `height` as the `y` property.
|
2017-10-13 13:11:54 +00:00
|
|
|
*
|
|
|
|
* @function Phaser.Geom.Rectangle.GetSize
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-27 13:27:08 +00:00
|
|
|
* @generic {Phaser.Geom.Point} O - [out,$return]
|
|
|
|
*
|
2020-02-04 16:19:42 +00:00
|
|
|
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the size from.
|
|
|
|
* @param {(Phaser.Geom.Point|object)} [out] - The Point object to store the size in. If not given, a new Point instance is created.
|
2017-10-13 13:11:54 +00:00
|
|
|
*
|
2020-02-04 16:19:42 +00:00
|
|
|
* @return {(Phaser.Geom.Point|object)} A Point object where `x` holds the width and `y` holds the height of the Rectangle.
|
2017-10-13 13:11:54 +00:00
|
|
|
*/
|
2016-12-20 17:07:16 +00:00
|
|
|
var GetSize = function (rect, out)
|
|
|
|
{
|
2017-10-13 13:11:54 +00:00
|
|
|
if (out === undefined) { out = new Point(); }
|
2016-12-20 17:07:16 +00:00
|
|
|
|
|
|
|
out.x = rect.width;
|
|
|
|
out.y = rect.height;
|
|
|
|
|
|
|
|
return out;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = GetSize;
|