Table of Contents

Struct ScreenSize

Namespace
LansMap.Core.Geo

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

width int

Width in screen px, greater than zero.

height int

Height in screen px, greater than zero.

Exceptions

ArgumentOutOfRangeException

Either dimension is zero or negative.

Properties

Height

Viewport height in screen px. Always positive.

public int Height { get; }

Property Value

int

Width

Viewport width in screen px. Always positive.

public int Width { get; }

Property Value

int