mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 12:33:38 +00:00
25 lines
749 B
JavaScript
25 lines
749 B
JavaScript
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
|
|
var Contains = require('./Contains');
|
|
|
|
/**
|
|
* Checks the given Point again the Polygon to see if the Point lays within its vertices.
|
|
*
|
|
* @function Phaser.Geom.Polygon.ContainsPoint
|
|
* @since 3.0.0
|
|
*
|
|
* @param {Phaser.Geom.Polygon} polygon - The Polygon to check.
|
|
* @param {Phaser.Geom.Point} point - The Point to check if it's within the Polygon.
|
|
*
|
|
* @return {boolean} `true` if the Point is within the Polygon, otherwise `false`.
|
|
*/
|
|
var ContainsPoint = function (polygon, point)
|
|
{
|
|
return Contains(polygon, point.x, point.y);
|
|
};
|
|
|
|
module.exports = ContainsPoint;
|