Struct UIRect
Definition
- Assembly:
- Tizen.NUI.dll
Represents a rectangular area by defining its position and size.
public struct UIRect : IEquatable<UIRect>
- Implements
-
IEquatable<><UIRect>
Constructors
View SourceUIRect(float, float, float, float)
Initializes a new instance of the UIRect struct.
Declaration
public UIRect(float x, float y, float width, float height)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x-coordinate of the upper-left corner of the rectangle. |
| float | y | The y-coordinate of the upper-left corner of the rectangle. |
| float | width | The width of the rectangle. |
| float | height | The height of the rectangle. |
Fields
View SourceZero
Gets a UIRect structure with all coordinates and sizes set to zero.
Declaration
public static readonly UIRect Zero
Field Value
| Type | Description |
|---|---|
| UIRect |
Properties
View SourceBottom
Gets the y-coordinate of the bottom edge of the rectangle.
Declaration
public float Bottom { get; }
Property Value
| Type | Description |
|---|---|
| float |
Center
Gets the center UIVector2 of the rectangle.
Declaration
public UIVector2 Center { get; }
Property Value
| Type | Description |
|---|---|
| UIVector2 |
Height
Gets or sets the height of the rectangle.
Declaration
public float Height { readonly get; init; }
Property Value
| Type | Description |
|---|---|
| float |
IsEmpty
Gets a value indicating whether this UIRect is empty.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Left
Gets the x-coordinate of the left edge of the rectangle.
Declaration
public float Left { get; }
Property Value
| Type | Description |
|---|---|
| float |
Location
Gets or sets the location of the upper-left corner of the rectangle.
Declaration
public UIVector2 Location { get; init; }
Property Value
| Type | Description |
|---|---|
| UIVector2 |
Right
Gets the x-coordinate of the right edge of the rectangle.
Declaration
public float Right { get; }
Property Value
| Type | Description |
|---|---|
| float |
Size
Gets or sets the size of the rectangle.
Declaration
public UIVector2 Size { get; init; }
Property Value
| Type | Description |
|---|---|
| UIVector2 |
Top
Gets the y-coordinate of the top edge of the rectangle.
Declaration
public float Top { get; }
Property Value
| Type | Description |
|---|---|
| float |
Width
Gets or sets the width of the rectangle.
Declaration
public float Width { readonly get; init; }
Property Value
| Type | Description |
|---|---|
| float |
X
Gets or sets the x-coordinate of the upper-left corner of the rectangle.
Declaration
public float X { readonly get; init; }
Property Value
| Type | Description |
|---|---|
| float |
Y
Gets or sets the y-coordinate of the upper-left corner of the rectangle.
Declaration
public float Y { readonly get; init; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
View SourceContains(float, float)
Indicates whether the specified UIVector2 is contained within the rectangular region defined by this UIRect structure.
Declaration
public bool Contains(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x-coordinate of the UIVector2 to test. |
| float | y | The y-coordinate of the UIVector2 to test. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Contains(UIRect)
Checks if the specified rectangle is completely inside this rectangle.
Declaration
public bool Contains(UIRect rect)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | rect | The rectangle to check. |
Returns
| Type | Description |
|---|---|
| bool | True if the specified rectangle is completely inside this rectangle, otherwise false. |
Contains(UIVector2)
Indicates whether the specified UIVector2 is contained within the rectangular region defined by this UIRect structure.
Declaration
public bool Contains(UIVector2 pt)
Parameters
| Type | Name | Description |
|---|---|---|
| UIVector2 | pt | The UIVector2 to test. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Deconstruct(out float, out float, out float, out float)
Deconstructs the UIRect object into its individual components (X, Y, Width, Height).
Declaration
public void Deconstruct(out float x, out float y, out float width, out float height)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The X coordinate of the rectangle. |
| float | y | The Y coordinate of the rectangle. |
| float | width | The width of the rectangle. |
| float | height | The height of the rectangle. |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Equals(UIRect)
Indicates whether this instance and another specified UIRect structure are equal.
Declaration
public bool Equals(UIRect other)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | other | The UIRect structure to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
FromLTRB(float, float, float, float)
Creates a new UIRect structure with the specified values.
Declaration
public static UIRect FromLTRB(float left, float top, float right, float bottom)
Parameters
| Type | Name | Description |
|---|---|---|
| float | left | The x-coordinate of the upper-left corner of the rectangle. |
| float | top | The y-coordinate of the upper-left corner of the rectangle. |
| float | right | The x-coordinate of the lower-right corner of the rectangle. |
| float | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Returns
| Type | Description |
|---|---|
| UIRect | A new UIRect structure with the specified values. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Inflate(float, float)
Inflates the current rectangle by the specified width and height.
Declaration
public UIRect Inflate(float width, float height)
Parameters
| Type | Name | Description |
|---|---|---|
| float | width | The amount to inflate the rectangle horizontally. |
| float | height | The amount to inflate the rectangle vertically. |
Returns
| Type | Description |
|---|---|
| UIRect | A new rectangle that represents the inflated version of the current rectangle. |
Inflate(UIVector2)
Returns a new UIRect structure that has been inflated by the specified amount.
Declaration
public UIRect Inflate(UIVector2 sz)
Parameters
| Type | Name | Description |
|---|---|---|
| UIVector2 | sz | The size of the inflation. |
Returns
| Type | Description |
|---|---|
| UIRect | A new UIRect structure that represents the inflated rectangle. |
Intersect(UIRect, UIRect)
Returns a new rectangle that represents the intersection of two given rectangles.
Declaration
public static UIRect Intersect(UIRect r1, UIRect r2)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r1 | The first rectangle. |
| UIRect | r2 | The second rectangle. |
Returns
| Type | Description |
|---|---|
| UIRect | A new rectangle representing the intersection of the two given rectangles. |
Intersect(UIRect)
Returns a new rectangle that represents the intersection of the current rectangle and the specified rectangle.
Declaration
public UIRect Intersect(UIRect r)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r | The rectangle to intersect with the current rectangle. |
Returns
| Type | Description |
|---|---|
| UIRect | A new rectangle that represents the intersection of the current rectangle specified rectangle. |
IntersectsWith(UIRect)
Indicates whether the rectangular region represented by this UIRect intersects with the rectangular region represented by the specified UIRect structure.
Declaration
public bool IntersectsWith(UIRect r)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r | The UIRect structure to test for intersection. |
Returns
| Type | Description |
|---|---|
| bool | true if the rectangular region represented by this UIRect intersects with the rectangular region represented by |
Offset(float, float)
Returns a new rectangle that is offset by the specified amount.
Declaration
public UIRect Offset(float dx, float dy)
Parameters
| Type | Name | Description |
|---|---|---|
| float | dx | The horizontal offset. |
| float | dy | The vertical offset. |
Returns
| Type | Description |
|---|---|
| UIRect | A new rectangle with the offset applied. |
Offset(UIVector2)
Returns a new UIRect that has been offset by the specified distance.
Declaration
public UIRect Offset(UIVector2 dr)
Parameters
| Type | Name | Description |
|---|---|---|
| UIVector2 | dr | The distance to offset the UIRect. |
Returns
| Type | Description |
|---|---|
| UIRect | A new UIRect that has been offset by the specified distance. |
Round()
Rounds the values of the X, Y, Width, and Height properties of the current UIRect object to the nearest whole number.
Declaration
public UIRect Round()
Returns
| Type | Description |
|---|---|
| UIRect | A new UIRect object with the rounded values. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Union(UIRect, UIRect)
Returns a rectangle that represents the union of the two given rectangles.
Declaration
public static UIRect Union(UIRect r1, UIRect r2)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r1 | The first rectangle. |
| UIRect | r2 | The second rectangle. |
Returns
| Type | Description |
|---|---|
| UIRect | A new rectangle that represents the union of the two given rectangles. |
Union(UIRect)
Returns a rectangle that represents the union of the current rectangle and the specified rectangle.
Declaration
public UIRect Union(UIRect r)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r | The rectangle to combine with the current rectangle. |
Returns
| Type | Description |
|---|---|
| UIRect | A new rectangle that represents the union of the current rectangle and the specified rectangle. |
Operators
View Sourceoperator ==(UIRect, UIRect)
Compares two UIRect structures for equality.
Declaration
public static bool operator ==(UIRect r1, UIRect r2)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r1 | The first UIRect structure to compare. |
| UIRect | r2 | The second UIRect structure to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if |
operator !=(UIRect, UIRect)
Compares two UIRect structures for inequality.
Declaration
public static bool operator !=(UIRect r1, UIRect r2)
Parameters
| Type | Name | Description |
|---|---|---|
| UIRect | r1 | The first UIRect structure to compare. |
| UIRect | r2 | The second UIRect structure to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if |