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
|
|
|
/**
|
2018-10-01 10:35:01 +00:00
|
|
|
* Nudges (translates) the top left corner of a Rectangle by a given offset.
|
2017-10-13 13:11:54 +00:00
|
|
|
*
|
|
|
|
* @function Phaser.Geom.Rectangle.Offset
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-27 13:27:08 +00:00
|
|
|
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
|
|
|
*
|
2018-10-01 10:35:01 +00:00
|
|
|
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.
|
|
|
|
* @param {number} x - The distance to move the Rectangle horizontally.
|
|
|
|
* @param {number} y - The distance to move the Rectangle vertically.
|
2017-10-13 13:11:54 +00:00
|
|
|
*
|
2018-10-01 10:35:01 +00:00
|
|
|
* @return {Phaser.Geom.Rectangle} The adjusted Rectangle.
|
2017-10-13 13:11:54 +00:00
|
|
|
*/
|
2016-12-28 23:41:02 +00:00
|
|
|
var Offset = function (rect, x, y)
|
|
|
|
{
|
|
|
|
rect.x += x;
|
|
|
|
rect.y += y;
|
|
|
|
|
|
|
|
return rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Offset;
|