arcade-physics
Version:
Use Arcade Physics without Phaser.
36 lines • 1.29 kB
JavaScript
;
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Rectangle_1 = __importDefault(require("../rectangle/Rectangle"));
/**
* Returns the bounds of the Circle object.
*
* @function Phaser.Geom.Circle.GetBounds
* @since 3.0.0
*
* @generic {Phaser.Geom.Rectangle} O - [out,$return]
*
* @param {Phaser.Geom.Circle} circle - The Circle to get the bounds from.
* @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created.
*
* @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Circles bounds.
*/
const GetBounds = (circle, out) => {
if (out === undefined) {
out = new Rectangle_1.default();
}
out.x = circle.left;
out.y = circle.top;
out.width = circle.diameter;
out.height = circle.diameter;
return out;
};
exports.default = GetBounds;
//# sourceMappingURL=GetBounds.js.map