Skip to content

RectangleExtensions Class

Extensions for the SadRogue.Primitives.Rectangle type.

C#
public static class RectangleExtensions

Inheritance object

Converts a rectangle from cells to pixels.

C#
public static Rectangle ToPixels(this Rectangle rect, Point fontSize)

rect SadRogue.Primitives.Rectangle
The rectangle to work with.

fontSize SadRogue.Primitives.Point
The font size used for translation.

SadRogue.Primitives.Rectangle
A new rectangle in pixels.

Converts a rectangle from cells to pixels.

C#
public static Rectangle ToPixels(this Rectangle rect, int cellWidth, int cellHeight)

rect SadRogue.Primitives.Rectangle
The rectangle to work with.

cellWidth int
The width of a cell used in converting.

cellHeight int
The height of a cell used in converting.

SadRogue.Primitives.Rectangle
A new rectangle in pixels.

Converts a rectangle from pixels to cells.

C#
public static Rectangle ToConsole(this Rectangle rect, Point fontSize)

rect SadRogue.Primitives.Rectangle
The rectangle to work with.

fontSize SadRogue.Primitives.Point
The font size used for translation.

SadRogue.Primitives.Rectangle
A new rectangle in cell coordinates.

Converts a rectangle from pixels to cells.

C#
public static Rectangle ToConsole(this Rectangle rect, int cellWidth, int cellHeight)

rect SadRogue.Primitives.Rectangle
The rectangle to work with.

cellWidth int
The width of a cell used in converting.

cellHeight int
The height of a cell used in converting.

SadRogue.Primitives.Rectangle
A new rectangle in cell coordinates.