SRect
| Fonction | Contains | Returns true if the x and y components of point is a point inside this rectangle. |
| Fonction | Overlaps | Returns true if the other rectangle overlaps this one. |
| Fonction | Equals | Returns true if the rectangles are the same. |
| Fonction | ToString | Returns string for this Rect. |
| Fonction | New | Constructs a new SRect |
| Propriété | X | – |
| Propriété | Y | – |
| Propriété | Width | – |
| Propriété | Height | – |
| Propriété | Position | The X and Y position of the rectangle. |
| Propriété | Center | The position of the center of the rectangle. |
| Propriété | Min | The position of the minimum corner of the rectangle. |
| Propriété | Max | The position of the maximum corner of the rectangle. |
| Propriété | Size | The width and height of the rectangle. |
| Propriété | XMin | The minimum X coordinate of the rectangle. |
| Propriété | YMin | The minimum Y coordinate of the rectangle. |
| Propriété | XMax | The maximum Y coordinate of the rectangle. |
| Propriété | YMax | The maximum Y coordinate of the rectangle. |
| Propriété | Left | – |
| Propriété | Right | – |
| Propriété | Top | – |
| Propriété | Bottom | – |
Fonctions
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.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| point | SVector | – |
| allowInverse | bool | – |
Valeurs de retour
bool
Exemple
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.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| other | SRect | – |
| allowInverse | bool | – |
Valeurs de retour
bool
Exemple
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.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| other | SRect | – |
Valeurs de retour
bool
Exemple
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
ToString
Returns string for this Rect.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| format | string | – |
Valeurs de retour
string
Exemple
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
New
Constructs a new SRect
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| x | float | – |
| y | float | – |
| width | float | – |
| height | float | – |
Valeurs de retour
SRect
Exemple
newRect=Rect.New(0,0,150,150)
Propriétés
X
Exemple
newRect=Rect.New(0,0,150,150)
newRect.X = 10.0
Y
Exemple
newRect=Rect.New(0,0,150,150)
newRect.Y = 10.0
Width
Exemple
newRect=Rect.New(0,0,150,150)
newRect.Width = 10.0
Height
Exemple
newRect=Rect.New(0,0,150,150)
newRect.Height = 10.0
PositionLecture seule
The X and Y position of the rectangle.
Exemple
newRect=Rect.New(50,50,150,150)
positionVector = newRect.position
CenterLecture seule
The position of the center of the rectangle.
Exemple
newRect = Rect.New(50,50,150,150)
VectorCenter = newRect.Center
MinLecture seule
The position of the minimum corner of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
vectorMin = newRect.Min
MaxLecture seule
The position of the maximum corner of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
vectorMax = newRect.Max
SizeLecture seule
The width and height of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
vectorSize = newRect.Size
XMinLecture seule
The minimum X coordinate of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
floatXMin = newRect.XMin
YMinLecture seule
The minimum Y coordinate of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
floatYMin = newRect.YMin
XMaxLecture seule
The maximum Y coordinate of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
floatXMax = newRect.XMax
YMaxLecture seule
The maximum Y coordinate of the rectangle.
Exemple
newRect=Rect.New(0,0,150,150)
floatYMax = newRect.YMax
LeftLecture seule
Exemple
newRect=Rect.New(0,0,150,150)
floatLeft = newRect.Left
RightLecture seule
Exemple
newRect=Rect.New(0,0,150,150)
floatRight = newRect.Right
TopLecture seule
Exemple
newRect=Rect.New(0,0,150,150)
floatTop = newRect.Top
BottomLecture seule
Exemple
newRect=Rect.New(0,0,150,150)
floatBottom = newRect.Bottom



