phaser/v3/src/geom/rectangle/ContainsXY.js

12 lines
252 B
JavaScript
Raw Normal View History

2016-12-20 17:07:16 +00:00
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;