CRect:RectInside


The RectInside method tests whether another CRect is interior to the current CRect object. The tests are made using <= or >= so that an identical rectangle boundary is considered to be inside. To be "inside", the other rectangle must have xmin and ymin >= current values and xmax and ymax <= current values.

Syntax

bSuccess = CRect:RectInside( CRect2 )

where

    CRect2 is another CRect.

    bSuccess is returned true if CRect2 is inside the current rectangle, otherwise false.

Example

The following script tests whether CRect R2 is inside CRect R:

R = NewRect(200,250,250,500)

-- create a CRect object

R2 = NewRect(200,225,225,400)

-- a rectangle with ymin outside R

test = R:RectInside(R2)

-- returns true or false

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

-- result: Inside = 0 (false)

Related Topics

PtInside

PtInsideInt

CRect class