SRect
| دالة | Contains | Returns true if the x and y components of point is a point inside this rectangle. |
| دالة | Overlaps | Returns true if the other rectangle overlaps this one. |
| دالة | Equals | Returns true if the rectangles are the same. |
| دالة | ToString | Returns string for this Rect. |
| دالة | New | Constructs a new SRect |
| خاصية | X | – |
| خاصية | Y | – |
| خاصية | Width | – |
| خاصية | Height | – |
| خاصية | Position | The X and Y position of the rectangle. |
| خاصية | Center | The position of the center of the rectangle. |
| خاصية | Min | The position of the minimum corner of the rectangle. |
| خاصية | Max | The position of the maximum corner of the rectangle. |
| خاصية | Size | The width and height of the rectangle. |
| خاصية | XMin | The minimum X coordinate of the rectangle. |
| خاصية | YMin | The minimum Y coordinate of the rectangle. |
| خاصية | XMax | The maximum Y coordinate of the rectangle. |
| خاصية | YMax | The maximum Y coordinate of the rectangle. |
| خاصية | Left | – |
| خاصية | Right | – |
| خاصية | Top | – |
| خاصية | Bottom | – |
الدوال
Contains
Returns true if the x and y components of point is a point inside this rectangle. If allowInverse is present and true, the width and height of the Rect are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| point | SVector | – |
| allowInverse | bool | – |
القيم المرجعة
bool
مثال
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
isContains = newRect.Contains(otherRect)
--or
isContains = newRect.Contains(otherRect , true)
Overlaps
Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| other | SRect | – |
| allowInverse | bool | – |
القيم المرجعة
bool
مثال
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
isOverlapping = newRect.Overlaps(otherRect)
--or
isOverlapping = newRect.Overlaps(otherRect , true)
Equals
Returns true if the rectangles are the same.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| other | SRect | – |
القيم المرجعة
bool
مثال
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
ToString
Returns string for this Rect.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| format | string | – |
القيم المرجعة
string
مثال
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
New
Constructs a new SRect
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| x | float | – |
| y | float | – |
| width | float | – |
| height | float | – |
القيم المرجعة
SRect
مثال
newRect=Rect.New(0,0,150,150)
الخصائص
X
مثال
newRect=Rect.New(0,0,150,150)
newRect.X = 10.0
Y
مثال
newRect=Rect.New(0,0,150,150)
newRect.Y = 10.0
Width
مثال
newRect=Rect.New(0,0,150,150)
newRect.Width = 10.0
Height
مثال
newRect=Rect.New(0,0,150,150)
newRect.Height = 10.0
Positionللقراءة فقط
The X and Y position of the rectangle.
مثال
newRect=Rect.New(50,50,150,150)
positionVector = newRect.position
Centerللقراءة فقط
The position of the center of the rectangle.
مثال
newRect = Rect.New(50,50,150,150)
VectorCenter = newRect.Center
Minللقراءة فقط
The position of the minimum corner of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
vectorMin = newRect.Min
Maxللقراءة فقط
The position of the maximum corner of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
vectorMax = newRect.Max
Sizeللقراءة فقط
The width and height of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
vectorSize = newRect.Size
XMinللقراءة فقط
The minimum X coordinate of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
floatXMin = newRect.XMin
YMinللقراءة فقط
The minimum Y coordinate of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
floatYMin = newRect.YMin
XMaxللقراءة فقط
The maximum Y coordinate of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
floatXMax = newRect.XMax
YMaxللقراءة فقط
The maximum Y coordinate of the rectangle.
مثال
newRect=Rect.New(0,0,150,150)
floatYMax = newRect.YMax
Leftللقراءة فقط
مثال
newRect=Rect.New(0,0,150,150)
floatLeft = newRect.Left
Rightللقراءة فقط
مثال
newRect=Rect.New(0,0,150,150)
floatRight = newRect.Right
Topللقراءة فقط
مثال
newRect=Rect.New(0,0,150,150)
floatTop = newRect.Top
Bottomللقراءة فقط
مثال
newRect=Rect.New(0,0,150,150)
floatBottom = newRect.Bottom



