Table of Contents

Struct IntRectangle

Namespace
Lime
Assembly
Lime.dll

Representation of integer 2D rectangles.

public struct IntRectangle : IEquatable<IntRectangle>
Implements
Inherited Members

Constructors

IntRectangle(IntVector2, IntVector2)

public IntRectangle(IntVector2 a, IntVector2 b)

Parameters

a IntVector2
b IntVector2

IntRectangle(int, int, int, int)

public IntRectangle(int left, int top, int right, int bottom)

Parameters

left int
top int
right int
bottom int

Fields

A

Left-top corner of this rectangle.

[YuzuMember("0")]
public IntVector2 A

Field Value

IntVector2

B

Right-bottom corner of this rectangle.

[YuzuMember("1")]
public IntVector2 B

Field Value

IntVector2

Remarks

Rectangle doesn't contain this point.

Empty

Returns a rectangle with both corners in 0, 0.

public static readonly IntRectangle Empty

Field Value

IntRectangle

Properties

Bottom

public int Bottom { get; set; }

Property Value

int

Center

public IntVector2 Center { get; }

Property Value

IntVector2

Height

public int Height { get; set; }

Property Value

int

this[int]

public int this[int component] { get; set; }

Parameters

component int

Property Value

int

Left

public int Left { get; set; }

Property Value

int

Normalized

Returns this rectangle with swapped coordinates of borders if width or height is negative.

public IntRectangle Normalized { get; }

Property Value

IntRectangle

Remarks

Width or height can be negative if coordinates of borders are mixed up. This property returns new IntRectangle with width and height that are guaranteed to be positive.

Right

public int Right { get; set; }

Property Value

int

Size

public IntVector2 Size { get; }

Property Value

IntVector2

Top

public int Top { get; set; }

Property Value

int

Width

public int Width { get; set; }

Property Value

int

Methods

Contains(IntVector2)

public bool Contains(IntVector2 value)

Parameters

value IntVector2

Returns

bool

Equals(IntRectangle)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(IntRectangle other)

Parameters

other IntRectangle

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Intersect(IntRectangle, IntRectangle)

Creates a new IntRectangle that contains overlapping region of two other rectangles.

public static IntRectangle Intersect(IntRectangle value1, IntRectangle value2)

Parameters

value1 IntRectangle
value2 IntRectangle

Returns

IntRectangle

OffsetBy(IntVector2)

Creates a new IntRectangle that has coordinates of this rectangle shifted by specified value.

public IntRectangle OffsetBy(IntVector2 value)

Parameters

value IntVector2

Returns

IntRectangle

ToString()

Returns the string representation of this IntRectangle in the format: "A.X, A.Y, B.X, B.Y".

public override string ToString()

Returns

string

Operators

operator ==(IntRectangle, IntRectangle)

public static bool operator ==(IntRectangle lhs, IntRectangle rhs)

Parameters

lhs IntRectangle
rhs IntRectangle

Returns

bool

explicit operator Rectangle(IntRectangle)

public static explicit operator Rectangle(IntRectangle value)

Parameters

value IntRectangle

Returns

Rectangle

explicit operator WindowRect(IntRectangle)

public static explicit operator WindowRect(IntRectangle value)

Parameters

value IntRectangle

Returns

WindowRect

operator !=(IntRectangle, IntRectangle)

public static bool operator !=(IntRectangle lhs, IntRectangle rhs)

Parameters

lhs IntRectangle
rhs IntRectangle

Returns

bool