CRect:Offset CRect:PtInside

CRect:PtInsideInt


The PtInsideInt method tests whether a point is interior to the CRect when the coordinates are all considered to be integers rather than real numbers.

Syntax

bSuccess = CRect:IsInsideInt( x, y )

bullet.gif    wherex and y are numbers representing the coordinates of the target point.

Remarks

This method handles the boundary case in which the point lies within the same integer value. For example, if xmin = 200.4, then any point x in the range 200 through 201 is considered to lie on the boundary xmin and is therefore considered inside the rectangle.

Example

The following script tests whether the point (225.2,300.6) is inside the CRect when tested using both PtInside() and PtInsideInt():

 

R = new_rect()

-- create a CRect object

R:Set(200.5,250,250,500)

 

x = 200.2 ; y = 300

 

test = R:PtInside(x,y)

-- returns true or false

Printf( "result= %d\n", test)

-- result: Inside = 0

test = R:PtInsideInt(x,y)

-- returns test = true or false

Printf( "result= %d\n", test)

-- result: Inside = 1

Related Topics

CRect class, PtInside, RectInside


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.