Struct Rect
Syntax
Constructors
Rect(Single, Single, Single, Single)
Declaration
public Rect(float x, float y, float width, float height)
Parameters
Fields
height
Declaration
Field Value
width
Declaration
Field Value
x
Declaration
Field Value
y
Declaration
Field Value
Properties
Center
The position of the center of the rectangle.
Declaration
public float2 Center { get; set; }
Property Value
Default
Declaration
public static Rect Default { get; }
Property Value
Size
The width and height of the rectangle.
Declaration
public float2 Size { get; set; }
Property Value
Methods
Clamp(Rect)
Declaration
public void Clamp(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
Contains(float2)
Returns true if pos
is inside this rectangle.
Declaration
public bool Contains(float2 pos)
Parameters
Type |
Name |
Description |
float2 |
pos |
|
Returns
IsEmpty()
Declaration
Returns
Region(Rect)
Returns a new rectangle translated and scaled by relative
.
Declaration
public Rect Region(in Rect relative)
Parameters
Type |
Name |
Description |
Rect |
relative |
|
Returns