Skip to content
Eduard Gushchin edited this page Jun 21, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.Rect2
Namespace Electron2D
Kind struct
Category Math and Data

Overview

Represents the rect2 value type.

Syntax

public struct Electron2D.Rect2 : System.IEquatable<Electron2D.Rect2>

Remarks

This type is part of the Electron2D 0.1.0 Preview public API.

Thread Safety

Instances of this type are not synchronized. Access them from the thread that owns the object unless the member documentation states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
End Property Gets or sets the end value.
Position Property Gets or sets the position value.
Size Property Gets or sets the size value.
Electron2D.Rect2(Electron2D.Vector2, Electron2D.Vector2) Constructor Initializes a new instance of the Rect2 type.
Electron2D.Rect2(System.Single, System.Single, System.Single, System.Single) Constructor Initializes a new instance of the Rect2 type.
Abs() Method Executes the abs operation.
Encloses(Electron2D.Rect2) Method Executes the encloses operation.
Equals(Electron2D.Rect2) Method Executes the equals operation.
Equals(System.Object) Method Executes the equals operation.
Expand(Electron2D.Vector2) Method Executes the expand operation.
GetArea() Method Gets the area value.
GetCenter() Method Gets the center value.
GetHashCode() Method Gets the hash code value.
Grow(System.Single) Method Executes the grow operation.
HasArea() Method Checks whether area is available.
HasPoint(Electron2D.Vector2) Method Checks whether point is available.
Intersection(Electron2D.Rect2) Method Executes the intersection operation.
Intersects(Electron2D.Rect2, System.Boolean) Method Executes the intersects operation.
IsEqualApprox(Electron2D.Rect2) Method Checks whether equal approx is true.
Merge(Electron2D.Rect2) Method Executes the merge operation.
ToString() Method Executes the to string operation.
op_Equality(Electron2D.Rect2, Electron2D.Rect2) Method Applies the == operator.
op_Inequality(Electron2D.Rect2, Electron2D.Rect2) Method Applies the != operator.

Member Details

End

Kind: Property

public Electron2D.Vector2 End { get; set; }

Summary

Gets or sets the end value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current end value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Position

Kind: Property

public Electron2D.Vector2 Position { get; set; }

Summary

Gets or sets the position value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current position value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Size

Kind: Property

public Electron2D.Vector2 Size { get; set; }

Summary

Gets or sets the size value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current size value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Electron2D.Rect2(Electron2D.Vector2, Electron2D.Vector2)

Kind: Constructor

public Electron2D.Rect2(Electron2D.Vector2 position, Electron2D.Vector2 size)

Summary

Initializes a new instance of the Rect2 type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Parameters

  • position: The position value.
  • size: The size value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Electron2D.Rect2(System.Single, System.Single, System.Single, System.Single)

Kind: Constructor

public Electron2D.Rect2(System.Single x, System.Single y, System.Single width, System.Single height)

Summary

Initializes a new instance of the Rect2 type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Parameters

  • x: The X coordinate or component.
  • y: The Y coordinate or component.
  • width: The width value.
  • height: The height value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Abs()

Kind: Method

public Electron2D.Rect2 Abs()()

Summary

Executes the abs operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Encloses(Electron2D.Rect2)

Kind: Method

public System.Boolean Encloses(Electron2D.Rect2)(Electron2D.Rect2 rect)

Summary

Executes the encloses operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • rect: The rect value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Equals(Electron2D.Rect2)

Kind: Method

public System.Boolean Equals(Electron2D.Rect2)(Electron2D.Rect2 other)

Summary

Executes the equals operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • other: The other value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Equals(System.Object)

Kind: Method

public System.Boolean Equals(System.Object)(System.Object obj)

Summary

Executes the equals operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • obj: The obj value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Expand(Electron2D.Vector2)

Kind: Method

public Electron2D.Rect2 Expand(Electron2D.Vector2)(Electron2D.Vector2 to)

Summary

Executes the expand operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • to: The to value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

GetArea()

Kind: Method

public System.Single GetArea()()

Summary

Gets the area value.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The current area value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

GetCenter()

Kind: Method

public Electron2D.Vector2 GetCenter()()

Summary

Gets the center value.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The current center value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

GetHashCode()

Kind: Method

public System.Int32 GetHashCode()()

Summary

Gets the hash code value.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The current hash code value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Grow(System.Single)

Kind: Method

public Electron2D.Rect2 Grow(System.Single)(System.Single amount)

Summary

Executes the grow operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • amount: The amount value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

HasArea()

Kind: Method

public System.Boolean HasArea()()

Summary

Checks whether area is available.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

HasPoint(Electron2D.Vector2)

Kind: Method

public System.Boolean HasPoint(Electron2D.Vector2)(Electron2D.Vector2 point)

Summary

Checks whether point is available.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • point: The point value.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Intersection(Electron2D.Rect2)

Kind: Method

public Electron2D.Rect2 Intersection(Electron2D.Rect2)(Electron2D.Rect2 rect)

Summary

Executes the intersection operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • rect: The rect value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Intersects(Electron2D.Rect2, System.Boolean)

Kind: Method

public System.Boolean Intersects(Electron2D.Rect2, System.Boolean)(Electron2D.Rect2 rect, System.Boolean includeBorders)

Summary

Executes the intersects operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • rect: The rect value.
  • includeBorders: The include borders value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

IsEqualApprox(Electron2D.Rect2)

Kind: Method

public System.Boolean IsEqualApprox(Electron2D.Rect2)(Electron2D.Rect2 rect)

Summary

Checks whether equal approx is true.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • rect: The rect value.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Merge(Electron2D.Rect2)

Kind: Method

public Electron2D.Rect2 Merge(Electron2D.Rect2)(Electron2D.Rect2 rect)

Summary

Executes the merge operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • rect: The rect value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

ToString()

Kind: Method

public System.String ToString()()

Summary

Executes the to string operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

op_Equality(Electron2D.Rect2, Electron2D.Rect2)

Kind: Method

public static System.Boolean op_Equality(Electron2D.Rect2, Electron2D.Rect2)(Electron2D.Rect2 left, Electron2D.Rect2 right)

Summary

Applies the == operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

op_Inequality(Electron2D.Rect2, Electron2D.Rect2)

Kind: Method

public static System.Boolean op_Inequality(Electron2D.Rect2, Electron2D.Rect2)(Electron2D.Rect2 left, Electron2D.Rect2 right)

Summary

Applies the != operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Rect2

Clone this wiki locally