Struct Rect
Syntax
[IdAlias("f216da154c4054842adb590807e977ba")]
public struct Rect
Constructors
Rect(Single, Single, Single, Single)
Declaration
public Rect(float x, float y, float width, float height)
Parameters
Type |
Name |
Description |
System.Single |
x |
|
System.Single |
y |
|
System.Single |
width |
|
System.Single |
height |
|
Fields
height
Declaration
Field Value
Type |
Description |
System.Single |
|
width
Declaration
Field Value
Type |
Description |
System.Single |
|
x
Declaration
Field Value
Type |
Description |
System.Single |
|
y
Declaration
Field Value
Type |
Description |
System.Single |
|
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
Type |
Description |
System.Boolean |
|
IsEmpty()
Declaration
Returns
Type |
Description |
System.Boolean |
|
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
Extension Methods