UNPKG

phaser

Version:

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.

29 lines (25 loc) 811 B
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * [description] * * @function Phaser.Geom.Intersects.RectangleToRectangle * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} rectA - [description] * @param {Phaser.Geom.Rectangle} rectB - [description] * * @return {boolean} [description] */ var RectangleToRectangle = function (rectA, rectB) { if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0) { return false; } return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom); }; module.exports = RectangleToRectangle;