Struct ScreenSize
A viewport size in pixels, validated non-zero.
public readonly struct ScreenSize
- Inherited Members
Remarks
Positive-only because outside a running player loop Unity's Screen.width/height can read 1, and fitting a view to that produced a world-wide zoom instead of the requested one. Failing here makes that a caught error rather than a map stranded at zoom 3.
Constructors
ScreenSize(int, int)
Creates a viewport size.
public ScreenSize(int width, int height)
Parameters
Exceptions
- ArgumentOutOfRangeException
Either dimension is zero or negative.
Properties
Height
Viewport height in screen px. Always positive.
public int Height { get; }
Property Value
Width
Viewport width in screen px. Always positive.
public int Width { get; }