phaser/src/geom/rectangle/GetSize.js

35 lines
822 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2019-01-15 16:20:22 +00:00
* @copyright 2019 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
/**
2019-06-17 20:03:22 +00:00
* The size of the Rectangle object, expressed as a Point object
* with the values of the width and height properties.
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]
*
2017-10-13 13:11:54 +00:00
* @param {Phaser.Geom.Rectangle} rect - [description]
2018-03-20 15:01:08 +00:00
* @param {(Phaser.Geom.Point|object)} [out] - [description]
2017-10-13 13:11:54 +00:00
*
2018-03-20 15:01:08 +00:00
* @return {(Phaser.Geom.Point|object)} [description]
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;