Skip to content

GraphicsAPI reference

Struct RectI

Namespace: MicroEngine.Graphics.Devices
Assembly: MicroEngine.Graphics.dll
Guide: The graphics device

An integer rectangle in pixels: origin top-left, x to the right, y down; right and bottom exclusive.

C#
public readonly struct RectI : IEquatable<RectI>

Implements

IEquatable<RectI>

Constructors

RectI(int, int, int, int)

An integer rectangle in pixels: origin top-left, x to the right, y down; right and bottom exclusive.

C#
public RectI(int X, int Y, int Width, int Height)

Parameters

X int

Left edge (inclusive).

Y int

Top edge (inclusive).

Width int

Width in pixels.

Height int

Height in pixels.

Properties

Bottom

Bottom edge (exclusive).

C#
public int Bottom { get; }

Property Value

int

Height

Height in pixels.

C#
public int Height { get; init; }

Property Value

int

IsEmpty

True when the rectangle covers no pixel.

C#
public bool IsEmpty { get; }

Property Value

bool

Right

Right edge (exclusive).

C#
public int Right { get; }

Property Value

int

Width

Width in pixels.

C#
public int Width { get; init; }

Property Value

int

X

Left edge (inclusive).

C#
public int X { get; init; }

Property Value

int

Y

Top edge (inclusive).

C#
public int Y { get; init; }

Property Value

int

Methods

Contains(RectI)

True when other lies entirely inside this rectangle.

C#
public bool Contains(RectI other)

Parameters

other RectI

Returns

bool

Deconstruct(out int, out int, out int, out int)

C#
public void Deconstruct(out int X, out int Y, out int Width, out int Height)

Parameters

X int

Y int

Width int

Height int

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(RectI)

C#
public bool Equals(RectI other)

Parameters

other RectI

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

Intersect(RectI)

The overlap of two rectangles (empty when they do not overlap).

C#
public RectI Intersect(RectI other)

Parameters

other RectI

Returns

RectI

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(RectI, RectI)

C#
public static bool operator ==(RectI left, RectI right)

Parameters

left RectI

right RectI

Returns

bool

operator !=(RectI, RectI)

C#
public static bool operator !=(RectI left, RectI right)

Parameters

left RectI

right RectI

Returns

bool