Class ConfigureWindowConfig
Holds the config state for the window.
Implements
Inherited Members
Namespace: SadConsole.Configuration
Assembly: SadConsole.dll
Syntax
public sealed class ConfigureWindowConfig : IConfigurator
Constructors
ConfigureWindowConfig()
Declaration
public ConfigureWindowConfig()
Properties
BorderlessWindowedFullscreen
When true, fullscreen mode uses a borderless window.
Declaration
public bool BorderlessWindowedFullscreen { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
CellsX
The amount of cells that fit in the window along the x-axis.
Declaration
public int CellsX { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
CellsY
The amount of cells that fit in the window along the y-axis.
Declaration
public int CellsY { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Fullscreen
When true, tells the game host to run in fullscreen mode.
Declaration
public bool Fullscreen { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
GameResolutionHeightInPixels
The rendering height of the game.
Declaration
public int GameResolutionHeightInPixels { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
GameResolutionWidthInPixels
The rendering width of the game.
Declaration
public int GameResolutionWidthInPixels { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
WindowHeightInPixels
The desired height of the game window in pixels.
Declaration
public int WindowHeightInPixels { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
WindowWidthInPixels
The desired width of the game window in pixels.
Declaration
public int WindowWidthInPixels { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
GetDeviceScreenSize(out int, out int)
Gets the size of the device screen in pixels.
Declaration
public void GetDeviceScreenSize(out int width, out int height)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | |
| int | height |
IsWindowSizeValid()
Validates that the window fits on the display.
Declaration
public bool IsWindowSizeValid()
Returns
| Type | Description |
|---|---|
| bool | True when the WindowWidthInPixels and WindowHeightInPixels are less than or equal to the screen size; otherwise, false. |
SetWindowSizeInCells(int, int, bool)
Sets the desired resolution of the SadConsole window in cells using the default font.
Declaration
public void SetWindowSizeInCells(int width, int height, bool zoom)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | How wide the window is in font cells. |
| int | height | How tall the window is in font cells. |
| bool | zoom | When true, creates a larger window to automatically zoom the contents. |
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.
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.
Declaration
public void SetWindowSizeInPixels(int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | The width of the window. |
| int | height | The height of the window. |