WindowSize
namespace Griff.Runtime;
public struct WindowSizeA size of the game’s window in pixels, as a player picks it from an options menu (see WindowSize): written and read as “1280x720”.
Properties
Section titled “Properties”Common
Section titled “Common”public static IReadOnlyList<WindowSize> Common { get; }The common 16:9 sizes, smallest first, that Fitting offers from: from 960x540 to 3840x2160.
Default
Section titled “Default”public static WindowSize Default { get; }The size a built game’s window opens at until the player picks one.
Height
Section titled “Height”public int Height { get; init; }IsValid
Section titled “IsValid”public bool IsValid { get; }Whether it’s a size a window can be: both sides at least a pixel.
public int Width { get; init; }Methods
Section titled “Methods”Deconstruct
Section titled “Deconstruct”public void Deconstruct(out int Width, out int Height)Equals
Section titled “Equals”public override bool Equals(object obj)Equals
Section titled “Equals”public bool Equals(WindowSize other)Fitting
Section titled “Fitting”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.
GetHashCode
Section titled “GetHashCode”public override int GetHashCode()ToString
Section titled “ToString”public override string ToString()“1280x720”.
TryParse
Section titled “TryParse”public static bool TryParse(string? text, out WindowSize size)Reads “1280x720” (an “x” or “×” between, spaces allowed), or says it can’t.