mirror of
https://github.com/photonstorm/phaser
synced 2025-01-28 04:45:10 +00:00
12 lines
252 B
JavaScript
12 lines
252 B
JavaScript
|
var ContainsXY = function (rect, x, y)
|
||
|
{
|
||
|
if (rect.width <= 0 || rect.height <= 0)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y);
|
||
|
};
|
||
|
|
||
|
module.exports = ContainsXY;
|