Skip to main content
Version: 15.x (API 15) [Current]

Struct Rectangle

Remarks​

C# version using System.Numerics.Vector2 instead of Dalamud.Bindings.ImGui.ImGui.ImVec2.

Assembly: Dalamud.dll​
Declaration
public readonly struct Rectangle : IEquatable<Rectangle>

Implements:
System.IEquatable<Dalamud.Interface.Utility.Rectangle>

Properties​

Minimum​

Declaration
public Vector2 Minimum { get; init; }

Maximum​

Declaration
public Vector2 Maximum { get; init; }

Size​

Declaration
public Vector2 Size { get; }

Width​

Gets the width of this rectangle.

Declaration
public float Width { get; }

Height​

Gets the height of this rectangle.

Declaration
public float Height { get; }

Center​

Gets the center of this rectangle.

Declaration
public Vector2 Center { get; }

IsInverted​

Gets a value indicating whether this rectangle is not correctly Dalamud.Interface.Utility.Rectangle.Orient()ed.

Declaration
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.

Declaration
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.

Declaration
public Vector2 TopLeft { get; }

Fields​

Zero​

A rectangle that is only the point Zero.

Declaration
public static readonly Rectangle Zero

Methods​

FromSize(Vector2, Vector2)​

Declaration
public static Rectangle FromSize(Vector2 minimum, Vector2 size)
Returns​

Dalamud.Interface.Utility.Rectangle

Parameters​
TypeName
System.Numerics.Vector2minimum
System.Numerics.Vector2size

FromSize(Vector2)​

Declaration
public static Rectangle FromSize(Vector2 size)
Returns​

Dalamud.Interface.Utility.Rectangle

Parameters​
TypeName
System.Numerics.Vector2size

FromSize(float, float)​

Declaration
public static Rectangle FromSize(float sizeX, float sizeY)
Returns​

Dalamud.Interface.Utility.Rectangle

Parameters​
TypeName
System.SinglesizeX
System.SinglesizeY

Contains(Vector2)​

Whether this rectangle contains the given point.

Declaration
public bool Contains(Vector2 point)
Returns​

System.Boolean: Whether the point is contained in the rectangle.

Parameters​
TypeNameDescription
System.Numerics.Vector2pointThe point to check.

Add(Vector2)​

Add a point to a rectangle, i.e. ensure that the point is within the rectangle.

Declaration
public Rectangle Add(Vector2 point)
Returns​

Dalamud.Interface.Utility.Rectangle: The minimum rectangle containing the added point and the entire prior rectangle.

Parameters​
TypeNameDescription
System.Numerics.Vector2pointThe point to add.

Expand(float)​

Expand the rectangle in all directions.

Declaration
public Rectangle Expand(float amount)
Returns​

Dalamud.Interface.Utility.Rectangle: The expanded rectangle.

Parameters​
TypeNameDescription
System.SingleamountThe amount to expand the rectangle by.

Expand(Vector2)​

Expand the rectangle in all directions.

Declaration
public Rectangle Expand(Vector2 amount)
Returns​

Dalamud.Interface.Utility.Rectangle: The expanded rectangle.

Parameters​
TypeNameDescription
System.Numerics.Vector2amountThe amount to expand the rectangle by in X and Y direction.

Overlaps(in Rectangle)​

Check whether this rectangle overlaps the given rectangle.

Declaration
public bool Overlaps(in Rectangle rect)
Returns​

System.Boolean: Whether a real overlap with measure greater than 0 exists between the two rectangles.

Parameters​
TypeNameDescription
Dalamud.Interface.Utility.RectanglerectThe other rectangle to check.

OverlapsLine(Vector2, Vector2)​

Check whether this rectangle overlaps the given line on at least one point.

Declaration
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​
TypeNameDescription
System.Numerics.Vector2lineStartOne end of the line.
System.Numerics.Vector2lineEndThe 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.

Declaration
public Rectangle Orient()
Returns​

Dalamud.Interface.Utility.Rectangle: An oriented rectangle.

ToString()​

Declaration
public override string ToString()
Returns​

System.String

GetHashCode()​

Declaration
public override int GetHashCode()
Returns​

System.Int32

Equals(object)​

Declaration
public override bool Equals(object obj)
Returns​

System.Boolean

Parameters​
TypeName
System.Objectobj

Equals(Rectangle)​

Declaration
public bool Equals(Rectangle other)
Returns​

System.Boolean

Parameters​
TypeName
Dalamud.Interface.Utility.Rectangleother

Deconstruct(out Vector2, out Vector2)​

Declaration
public void Deconstruct(out Vector2 Minimum, out Vector2 Maximum)
Parameters​
TypeName
System.Numerics.Vector2Minimum
System.Numerics.Vector2Maximum

Implements​

  • System.IEquatable<Dalamud.Interface.Utility.Rectangle>