Struct Rectangle
Remarks
C# version using System.Numerics.Vector2 instead of Dalamud.Bindings.ImGui.ImGui.ImVec2.
Assembly: Dalamud.dll
public readonly struct Rectangle : IEquatable<Rectangle>
Implements:
System.IEquatable<Dalamud.Interface.Utility.Rectangle>
Properties
Minimum
public Vector2 Minimum { get; init; }
Maximum
public Vector2 Maximum { get; init; }
Size
public Vector2 Size { get; }
Width
Gets the width of this rectangle.
public float Width { get; }
Height
Gets the height of this rectangle.
public float Height { get; }
Center
Gets the center of this rectangle.
public Vector2 Center { get; }
IsInverted
Gets a value indicating whether this rectangle is not correctly Dalamud.Interface.Utility.Rectangle.Orient()ed.
public bool IsInverted { get; }
BottomRight
Gets one of the corners not stored. If this rectangle is oriented (see Dalamud.Interface.Utility.Rectangle.Orient()), this is at the bottom right.
public Vector2 BottomRight { get; }
TopLeft
Gets one of the corners not stored. If this rectangle is oriented (see Dalamud.Interface.Utility.Rectangle.Orient()), this is at the top left.
public Vector2 TopLeft { get; }
Fields
Zero
A rectangle that is only the point Zero.
public static readonly Rectangle Zero
Methods
FromSize(Vector2, Vector2)
public static Rectangle FromSize(Vector2 minimum, Vector2 size)
Returns
Dalamud.Interface.Utility.Rectangle
Parameters
| Type | Name |
|---|---|
System.Numerics.Vector2 | minimum |
System.Numerics.Vector2 | size |
FromSize(Vector2)
public static Rectangle FromSize(Vector2 size)
Returns
Dalamud.Interface.Utility.Rectangle
Parameters
| Type | Name |
|---|---|
System.Numerics.Vector2 | size |
FromSize(float, float)
public static Rectangle FromSize(float sizeX, float sizeY)
Returns
Dalamud.Interface.Utility.Rectangle
Parameters
| Type | Name |
|---|---|
System.Single | sizeX |
System.Single | sizeY |
Contains(Vector2)
Whether this rectangle contains the given point.
public bool Contains(Vector2 point)
Returns
System.Boolean: Whether the point is contained in the rectangle.
Parameters
| Type | Name | Description |
|---|---|---|
System.Numerics.Vector2 | point | The point to check. |
Add(Vector2)
Add a point to a rectangle, i.e. ensure that the point is within the rectangle.
public Rectangle Add(Vector2 point)
Returns
Dalamud.Interface.Utility.Rectangle: The minimum rectangle containing the added point and the entire prior rectangle.
Parameters
| Type | Name | Description |
|---|---|---|
System.Numerics.Vector2 | point | The point to add. |
Expand(float)
Expand the rectangle in all directions.
public Rectangle Expand(float amount)
Returns
Dalamud.Interface.Utility.Rectangle: The expanded rectangle.
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | amount | The amount to expand the rectangle by. |
Expand(Vector2)
Expand the rectangle in all directions.
public Rectangle Expand(Vector2 amount)
Returns
Dalamud.Interface.Utility.Rectangle: The expanded rectangle.
Parameters
| Type | Name | Description |
|---|---|---|
System.Numerics.Vector2 | amount | The amount to expand the rectangle by in X and Y direction. |
Overlaps(in Rectangle)
Check whether this rectangle overlaps the given rectangle.
public bool Overlaps(in Rectangle rect)
Returns
System.Boolean: Whether a real overlap with measure greater than 0 exists between the two rectangles.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.Utility.Rectangle | rect | The other rectangle to check. |
OverlapsLine(Vector2, Vector2)
Check whether this rectangle overlaps the given line on at least one point.
public bool OverlapsLine(Vector2 lineStart, Vector2 lineEnd)
Returns
System.Boolean: Whether at least one point lies both in the rectangle and on the line.
Parameters
| Type | Name | Description |
|---|---|---|
System.Numerics.Vector2 | lineStart | One end of the line. |
System.Numerics.Vector2 | lineEnd | The other end of the line. |
Orient()
Orient this rectangle, so that Dalamud.Interface.Utility.Rectangle.Minimum is the lower left corner and Dalamud.Interface.Utility.Rectangle.Maximum is the upper right corner.
public Rectangle Orient()
Returns
Dalamud.Interface.Utility.Rectangle: An oriented rectangle.
ToString()
public override string ToString()
Returns
System.String
GetHashCode()
public override int GetHashCode()
Returns
System.Int32
Equals(object)
public override bool Equals(object obj)
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
System.Object | obj |
Equals(Rectangle)
public bool Equals(Rectangle other)
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
| Dalamud.Interface.Utility.Rectangle | other |
Deconstruct(out Vector2, out Vector2)
public void Deconstruct(out Vector2 Minimum, out Vector2 Maximum)
Parameters
| Type | Name |
|---|---|
System.Numerics.Vector2 | Minimum |
System.Numerics.Vector2 | Maximum |
Implements
System.IEquatable<Dalamud.Interface.Utility.Rectangle>