All pages
Powered by GitBook
1 of 1

Loading...

SRect

Index

Functions Index

Function

Properties Index

Property

Functions

Contains

bool Contains ( point) bool Contains ( 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.

Parameter
Type
Description

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.

Parameter
Type
Description

Equals

bool Equals (SRect other)

Returns true if the rectangles are the same.

Parameter
Type
Description

ToString

string ToString (string format) string ToString ()

Returns string for this Rect.

Parameter
Type
Description

New

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

Constructs a new SRect

Parameter
Type
Description

Properties

X

float X get set

Property Description

Y

float Y get set

Property Description

Width

float Width get set

Property Description

Height

float Height get set

Property Description

Position

Position get

The X and Y position of the rectangle.

Center

Center get

The position of the center of the rectangle.

Min

Min get

The position of the minimum corner of the rectangle.

Max

Max get

The position of the maximum corner of the rectangle.

Size

Size get

The width and height of the rectangle.

XMin

float XMin get

The minimum X coordinate of the rectangle.

YMin

float YMin get

The minimum Y coordinate of the rectangle.

XMax

float XMax get

The maximum Y coordinate of the rectangle.

YMax

float YMax get

The maximum Y coordinate of the rectangle.

Left

float Left get

Property Description

Right

float Right get

Property Description

Top

float Top get

Property Description

Bottom

float Bottom get

Property Description

float get

float get

float get

float get

float get

float get

float get

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

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

bool Equals (SRect other)

string ToString (string format) string ToString ()

Static Functions

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

float X get set

float Y get set

float Width get set

float Height get set

SVector Position get

SVector Center get

SVector Min get

SVector Max get

SVector Size get

SVector
SVector
SVector
SVector
SVector
SVector
SVector

float get

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

isContains = newRect.Contains(otherRect)
--or
isContains = newRect.Contains(otherRect , true)
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)

isOverlapping = newRect.Overlaps(otherRect)
--or
isOverlapping = newRect.Overlaps(otherRect , true)
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
newRect=Rect.New(0,0,150,150)
newRect=Rect.New(0,0,150,150)
newRect.X = 10.0
newRect=Rect.New(0,0,150,150)
newRect.Y = 10.0
newRect=Rect.New(0,0,150,150)
newRect.Width = 10.0
newRect=Rect.New(0,0,150,150)
newRect.Height = 10.0
newRect=Rect.New(50,50,150,150)
positionVector = newRect.position
newRect = Rect.New(50,50,150,150)
VectorCenter = newRect.Center
newRect=Rect.New(0,0,150,150)
vectorMin = newRect.Min
newRect=Rect.New(0,0,150,150)
vectorMax = newRect.Max
newRect=Rect.New(0,0,150,150)
vectorSize = newRect.Size
newRect=Rect.New(0,0,150,150)
floatXMin = newRect.XMin
newRect=Rect.New(0,0,150,150)
floatYMin = newRect.YMin
newRect=Rect.New(0,0,150,150)
floatXMax = newRect.XMax
newRect=Rect.New(0,0,150,150)
floatYMax = newRect.YMax
newRect=Rect.New(0,0,150,150)
floatLeft = newRect.Left
newRect=Rect.New(0,0,150,150)
floatRight = newRect.Right
newRect=Rect.New(0,0,150,150)
floatTop = newRect.Top
newRect=Rect.New(0,0,150,150)
floatBottom = newRect.Bottom
XMin
YMin
XMax
YMax
Left
Right
Top
Bottom