Skip to content

ConfigureWindowConfig Class

Holds the config state for the window.

C#
public sealed class ConfigureWindowConfig : IConfigurator

Inheritance object

Implements IConfigurator

C#
public ConfigureWindowConfig()

The desired width of the game window in pixels.

C#
public int WindowWidthInPixels { get; set; }

The desired height of the game window in pixels.

C#
public int WindowHeightInPixels { get; set; }

The rendering width of the game.

C#
public int GameResolutionWidthInPixels { get; set; }

The rendering height of the game.

C#
public int GameResolutionHeightInPixels { get; set; }

The amount of cells that fit in the window along the x-axis.

C#
public int CellsX { get; set; }

The amount of cells that fit in the window along the y-axis.

C#
public int CellsY { get; set; }

When true, tells the game host to run in fullscreen mode.

C#
public bool Fullscreen { get; set; }

When true, fullscreen mode uses a borderless window.

C#
public bool BorderlessWindowedFullscreen { get; set; }

Sets the desired resolution of the SadConsole window in pixels. The output surface and initial cell counts are calculated based on the current font, and set to a value that allows the most cells to appear on screen.

C#
public void SetWindowSizeInPixels(int width, int height)

width int
The width of the window.

height int
The height of the window.

Sets the desired resolution of the SadConsole window in cells using the default font.

C#
public void SetWindowSizeInCells(int width, int height, bool zoom)

width int
How wide the window is in font cells.

height int
How tall the window is in font cells.

zoom bool
When true, creates a larger window to automatically zoom the contents.

The width and height values are used to generate the game window based on how large the font is. For example, if the font is 10x8, and you request window size of 20x20, a window is created with a width of 10 * 20 and a height of 8 * 20 in pixels, which is 200x160. When zoom is set to true, the window will try to get as big as possible while keeping the SadConsole output crisp.

Gets the size of the device screen in pixels.

C#
public void GetDeviceScreenSize(out int width, out int height)

width int

height int

Validates that the window fits on the display.

C#
public bool IsWindowSizeValid()

bool
True when the WindowWidthInPixels and WindowHeightInPixels are less than or equal to the screen size; otherwise, false.