Breakroom is now Sinewave Campus. Book a meeting

SRect

العميلالأنواع
في هذا الصنفContains
  1. الدوال
  2. Contains
  3. Overlaps
  4. Equals
  5. ToString
  6. New
  7. الخصائص
  8. X
  9. Y
  10. Width
  11. Height
  12. Position
  13. Center
  14. Min
  15. Max
  16. Size
  17. XMin
  18. YMin
  19. XMax
  20. YMax
  21. Left
  22. Right
  23. Top
  24. Bottom
الأعضاء 22
دالةContainsReturns true if the x and y components of point is a point inside this rectangle.
دالةOverlapsReturns true if the other rectangle overlaps this one.
دالةEqualsReturns true if the rectangles are the same.
دالةToStringReturns string for this Rect.
دالةNewConstructs a new SRect
خاصيةX–
خاصيةY–
خاصيةWidth–
خاصيةHeight–
خاصيةPositionThe X and Y position of the rectangle.
خاصيةCenterThe position of the center of the rectangle.
خاصيةMinThe position of the minimum corner of the rectangle.
خاصيةMaxThe position of the maximum corner of the rectangle.
خاصيةSizeThe width and height of the rectangle.
خاصيةXMinThe minimum X coordinate of the rectangle.
خاصيةYMinThe minimum Y coordinate of the rectangle.
خاصيةXMaxThe maximum Y coordinate of the rectangle.
خاصيةYMaxThe maximum Y coordinate of the rectangle.
خاصيةLeft–
خاصيةRight–
خاصيةTop–
خاصيةBottom–

الدوال​

Contains​

bool Contains(SVector point)
bool Contains(SVector point, bool allowInverse)

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.

المعاملات

الاسمالنوعالقيمة الافتراضية
pointSVector–
allowInversebool–

القيم المرجعة

bool

مثال

Lua
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​

bool Overlaps(SRect other)
bool Overlaps(SRect other, bool allowInverse)

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.

المعاملات

الاسمالنوعالقيمة الافتراضية
otherSRect–
allowInversebool–

القيم المرجعة

bool

مثال

Lua
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​

bool Equals(SRect other)

Returns true if the rectangles are the same.

المعاملات

الاسمالنوعالقيمة الافتراضية
otherSRect–

القيم المرجعة

bool

مثال

Lua
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)

ToString​

string ToString(string format)
string ToString()

Returns string for this Rect.

المعاملات

الاسمالنوعالقيمة الافتراضية
formatstring–

القيم المرجعة

string

مثال

Lua
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)

New​

static SRect New(float x, float y, float width, float height)

Constructs a new SRect

المعاملات

الاسمالنوعالقيمة الافتراضية
xfloat–
yfloat–
widthfloat–
heightfloat–

القيم المرجعة

SRect

مثال

Lua
newRect=Rect.New(0,0,150,150)

الخصائص​

X​

float X {get; set; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
newRect.X = 10.0

Y​

float Y {get; set; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
newRect.Y = 10.0

Width​

float Width {get; set; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
newRect.Width = 10.0

Height​

float Height {get; set; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
newRect.Height = 10.0

Positionللقراءة فقط​

SVector Position {get; }

The X and Y position of the rectangle.

مثال

Lua
newRect=Rect.New(50,50,150,150)
positionVector = newRect.position

Centerللقراءة فقط​

SVector Center {get; }

The position of the center of the rectangle.

مثال

Lua
newRect = Rect.New(50,50,150,150)
VectorCenter = newRect.Center

Minللقراءة فقط​

SVector Min {get; }

The position of the minimum corner of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
vectorMin = newRect.Min

Maxللقراءة فقط​

SVector Max {get; }

The position of the maximum corner of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
vectorMax = newRect.Max

Sizeللقراءة فقط​

SVector Size {get; }

The width and height of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
vectorSize = newRect.Size

XMinللقراءة فقط​

float XMin {get; }

The minimum X coordinate of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatXMin = newRect.XMin

YMinللقراءة فقط​

float YMin {get; }

The minimum Y coordinate of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatYMin = newRect.YMin

XMaxللقراءة فقط​

float XMax {get; }

The maximum Y coordinate of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatXMax = newRect.XMax

YMaxللقراءة فقط​

float YMax {get; }

The maximum Y coordinate of the rectangle.

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatYMax = newRect.YMax

Leftللقراءة فقط​

float Left {get; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatLeft = newRect.Left
float Right {get; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatRight = newRect.Right

Topللقراءة فقط​

float Top {get; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatTop = newRect.Top

Bottomللقراءة فقط​

float Bottom {get; }

مثال

Lua
newRect=Rect.New(0,0,150,150)
floatBottom = newRect.Bottom