Skip to content

WindowSize

namespace Griff.Runtime;
public struct WindowSize

A size of the game’s window in pixels, as a player picks it from an options menu (see WindowSize): written and read as “1280x720”.

public static IReadOnlyList<WindowSize> Common { get; }

The common 16:9 sizes, smallest first, that Fitting offers from: from 960x540 to 3840x2160.

public static WindowSize Default { get; }

The size a built game’s window opens at until the player picks one.

public int Height { get; init; }
public bool IsValid { get; }

Whether it’s a size a window can be: both sides at least a pixel.

public int Width { get; init; }
public void Deconstruct(out int Width, out int Height)
public override bool Equals(object obj)
public bool Equals(WindowSize other)
public static IReadOnlyList<WindowSize> Fitting(WindowSize? room)

The Common sizes that fit in room (the most a window’s game can show on the screen: its work area less the window’s frame), smallest first; at least the smallest, however little room there is. With no room given (a host that can’t say, a browser), those up to 1920x1080.

public override int GetHashCode()
public override string ToString()

“1280x720”.

public static bool TryParse(string? text, out WindowSize size)

Reads “1280x720” (an “x” or “×” between, spaces allowed), or says it can’t.