CPolygon:PtInside
The PtInside method tests whether a point is interior to the CPolygon. The tests are made using <= or >= so that a point exactly on a CPolygon boundary is considered to be inside.
bSuccess = CPolygon:PtInside( CPoint ) bSuccess = CPolygon:PtInside( x, y ) where x, y are the point coordinates. CPoint is a CPoint object. bSuccess is returned true if the point is inside the rectangle, otherwise false. |
The following script tests whether the point (225,300) is inside the CPolygon:
|
-- create a table of x values |
|
-- create a table of y values |
|
-- create a CPolygon object |
|
|
|
-- returns test = true or false |
|
-- result: Inside = 0 |