ConfigureWindowConfig Class
Definition
Section titled “Definition”Holds the config state for the window.
public sealed class ConfigureWindowConfig : IConfiguratorInheritance object
Implements IConfigurator
Constructors
Section titled “Constructors”ConfigureWindowConfig()
Section titled “ConfigureWindowConfig()”public ConfigureWindowConfig()Properties
Section titled “Properties”WindowWidthInPixels
Section titled “WindowWidthInPixels”The desired width of the game window in pixels.
public int WindowWidthInPixels { get; set; }WindowHeightInPixels
Section titled “WindowHeightInPixels”The desired height of the game window in pixels.
public int WindowHeightInPixels { get; set; }GameResolutionWidthInPixels
Section titled “GameResolutionWidthInPixels”The rendering width of the game.
public int GameResolutionWidthInPixels { get; set; }GameResolutionHeightInPixels
Section titled “GameResolutionHeightInPixels”The rendering height of the game.
public int GameResolutionHeightInPixels { get; set; }CellsX
Section titled “CellsX”The amount of cells that fit in the window along the x-axis.
public int CellsX { get; set; }CellsY
Section titled “CellsY”The amount of cells that fit in the window along the y-axis.
public int CellsY { get; set; }Fullscreen
Section titled “Fullscreen”When true, tells the game host to run in fullscreen mode.
public bool Fullscreen { get; set; }BorderlessWindowedFullscreen
Section titled “BorderlessWindowedFullscreen”When true, fullscreen mode uses a borderless window.
public bool BorderlessWindowedFullscreen { get; set; }Methods
Section titled “Methods”SetWindowSizeInPixels(int, int)
Section titled “SetWindowSizeInPixels(int, int)”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.
public void SetWindowSizeInPixels(int width, int height)Parameters
Section titled “Parameters”width int
The width of the window.
height int
The height of the window.
SetWindowSizeInCells(int, int, bool)
Section titled “SetWindowSizeInCells(int, int, bool)”Sets the desired resolution of the SadConsole window in cells using the default font.
public void SetWindowSizeInCells(int width, int height, bool zoom)Parameters
Section titled “Parameters”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.
Remarks
Section titled “Remarks”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.
GetDeviceScreenSize(out int, out int)
Section titled “GetDeviceScreenSize(out int, out int)”Gets the size of the device screen in pixels.
public void GetDeviceScreenSize(out int width, out int height)Parameters
Section titled “Parameters”width int
height int
IsWindowSizeValid()
Section titled “IsWindowSizeValid()”Validates that the window fits on the display.
public bool IsWindowSizeValid()Returns
Section titled “Returns”bool
True when the WindowWidthInPixels and WindowHeightInPixels are less than or equal to the screen size; otherwise, false.