Click or drag to resize

Rectangle Structure

Represents a rectangle specifying a position and size which uses integer values.

Namespace:  Syroot.Maths
Assembly:  Syroot.Maths (in Syroot.Maths.dll) Version: 1.5.0-alpha1
Syntax
public struct Rectangle : IEquatable<Rectangle>, 
	IEquatableByRef<Rectangle>

The Rectangle type exposes the following members.

Constructors
  NameDescription
Public methodRectangle(Vector2, Vector2)
Initializes a new instance of the Rectangle structure with the given values for the position and size components.
Public methodRectangle(Int32, Int32, Int32, Int32)
Initializes a new instance of the Rectangle structure with the given values for the position and size components.
Top
Properties
  NameDescription
Public propertyPosition
Gets or sets the positional Vector2 of this rectangle, representing the X and Y members.
Public propertySize
Gets or sets the sizing Vector2 of this rectangle, representing the Width and Height members.
Public propertyX2
Gets or sets the end coordinate on the X axis.
Public propertyY2
Gets or sets the end coordinate on the Y axis.
Top
Methods
  NameDescription
Public methodEquals(Object)
Gets a value indicating whether the components of this Rectangle are the same as the components of the second specified Rectangle.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Rectangle)
Indicates whether the current Rectangle is equal to another Rectangle.
Public methodEquals(Rectangle)
Indicates whether the current Rectangle is equal to another Rectangle. Structures are passed by reference to avoid stack structure copying.
Public methodGetHashCode
Gets a hash code as an indication for object equality.
(Overrides ValueTypeGetHashCode.)
Public methodToString
Gets a string describing the components of this Rectangle.
(Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Gets a value indicating whether the components of the first specified Rectangle are the same as the components of the second specified Rectangle.
Public operatorStatic member(RectangleF to Rectangle)
Explicit conversion from RectangleF
Public operatorStatic memberInequality
Gets a value indicating whether the components of the first specified Rectangle are not the same as the components of the second specified Rectangle.
Top
Fields
  NameDescription
Public fieldHeight
The integer height of the rectangle.
Public fieldStatic memberOne
A Rectangle at position 0, 0 and a width and height of 1.
Public fieldStatic memberSizeInBytes
Gets the size of this structure.
Public fieldStatic memberValueCount
Gets the amount of value types required to represent this structure.
Public fieldWidth
The integer width of the rectangle.
Public fieldX
The X integer component.
Public fieldY
The Y integer component.
Public fieldStatic memberZero
A Rectangle at position 0, 0 and a width and height of 0.
Top
See Also