build/phaser-spine.js
function (polygon, x, y) {
		var nn = polygon.length;
		var prevIndex = nn - 2;
		var inside = false;
		for (var ii = 0; ii < nn; ii += 2) {
			var vertexY = polygon[ii + 1];
			var prevY = polygon[prevIndex + 1];
			if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {
				var vertexX = polygon[ii];
				if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside;
			}
			prevIndex = ii;
		}
		return inside;
	}
function (polygon, x, y) {
		var nn = polygon.length;
		var prevIndex = nn - 2;
		var inside = false;
		for (var ii = 0; ii < nn; ii += 2) {
			var vertexY = polygon[ii + 1];
			var prevY = polygon[prevIndex + 1];
			if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {
				var vertexX = polygon[ii];
				if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside;
			}
			prevIndex = ii;
		}
		return inside;
	}
function ( polygon , x , y ) { var nn = polygon . length ; var prevIndex = nn - 2 ; var inside = false ; for ( var ii = 0 ; ii < nn ; ii += 2 ) { var vertexY = polygon [ ii + 1 ] ; var prevY = polygon [ prevIndex + 1 ] ; if ( ( vertexY < y && prevY >= y ) || ( prevY < y && vertexY >= y ) ) { var vertexX = polygon [ ii ] ; if ( vertexX + ( y - vertexY ) / ( prevY - vertexY ) * ( polygon [ prevIndex ] - vertexX ) < x ) inside = ! inside ; } prevIndex = ii ; } return inside ; }
Returns true if the polygon contains the point.
Returns true if the polygon contains the point .