KernelAPI reference
Class GameSettings
Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time
Window/backbuffer settings a game declares. The virtual size is the canvas everything is drawn on: 320×180 pixel art by default, or a high-resolution canvas such as 1280×720 or 1920×1080 with HighResolution2D.
public sealed record GameSettings : IEquatable<GameSettings>Inheritance
Implements
Constructors
GameSettings(string, int, int, int)
Window/backbuffer settings a game declares. The virtual size is the canvas everything is drawn on: 320×180 pixel art by default, or a high-resolution canvas such as 1280×720 or 1920×1080 with HighResolution2D.
public GameSettings(string Title, int VirtualWidth = 320, int VirtualHeight = 180, int Scale = 4)Parameters
Title string
Window title and application name shown by the system.
VirtualWidth int
Width of the virtual canvas in pixels (320 by default). Everything is drawn in these pixels and scaled to the window.
VirtualHeight int
Height of the virtual canvas in pixels (180 by default).
Scale int
Initial window size as a multiple of the virtual size on desktop (4 by default); the launcher’s –scale overrides
it. A window that would not fit the display opens at the largest size that does.
Properties
Background
Colour the canvas is cleared to before the scenes draw each frame (black by default).
public Color Background { get; init; }Property Value
DefaultTextureFilter
The filter textures get when they do not choose one: TextureFilter, or the magnification filter of the presentation’s default sampler.
public TextureFilter DefaultTextureFilter { get; }Property Value
Graphics
Graphics options: platform, graphics API, VSync, frame limit, GPU, window mode and display (all automatic by default).
public GraphicsSettings Graphics { get; init; }Property Value
Letterbox
Colour of the window around the frame when the window’s shape differs from the canvas (black by default).
public Color Letterbox { get; init; }Property Value
Presentation
How the canvas reaches the window, one choice per field (scale rounding, aspect, the canvas’s upscale sampler, the
textures’ default sampler, the capture scale, whole-factor windows, camera snapping, the UI scale).
PixelArt by default; a high-resolution game sets
HighResolution2D, and a game that needs another combination starts from a preset
and changes what it needs: Presentation = Presentation.PixelArt with { Upscale = SamplerDescription.LinearClamp }.
public Presentation Presentation { get; init; }Property Value
Exceptions
The value is null.
Scale
Initial window size as a multiple of the virtual size on desktop (4 by default); the launcher’s –scale overrides
it. A window that would not fit the display opens at the largest size that does.
public int Scale { get; init; }Property Value
TextureFilter
The filter of textures created without one (images, atlases). Null (the default) follows the presentation’s default sampler (DefaultSampler): nearest for pixel art, linear for high-resolution 2D. Each texture can still choose its own. Glyph pages of TTF/OTF fonts do not follow it: their filter is Filter, or linear for antialiased text and nearest otherwise.
public TextureFilter? TextureFilter { get; init; }Property Value
Title
Window title and application name shown by the system.
public string Title { get; init; }Property Value
UpdateRate
Fixed simulation rate in updates per second.
public int UpdateRate { get; init; }Property Value
VirtualHeight
Height of the virtual canvas in pixels (180 by default).
public int VirtualHeight { get; init; }Property Value
VirtualWidth
Width of the virtual canvas in pixels (320 by default). Everything is drawn in these pixels and scaled to the window.
public int VirtualWidth { get; init; }Property Value
Methods
<Clone>$()
public GameSettings <Clone>$()Returns
Deconstruct(out string, out int, out int, out int)
public void Deconstruct(out string Title, out int VirtualWidth, out int VirtualHeight, out int Scale)Parameters
Title string
VirtualWidth int
VirtualHeight int
Scale int
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(GameSettings?)
public bool Equals(GameSettings? other)Parameters
other GameSettings?
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(GameSettings?, GameSettings?)
public static bool operator ==(GameSettings? left, GameSettings? right)Parameters
left GameSettings?
right GameSettings?
Returns
operator !=(GameSettings?, GameSettings?)
public static bool operator !=(GameSettings? left, GameSettings? right)Parameters
left GameSettings?
right GameSettings?