Skip to content

Configuration

interludesoftware.tick

Interlude.Tick

Configuration Struct

public struct Configuration

Fields

Configuration.AspectRatioLayouts Field

Predefined layout resolutions for common aspect ratios. Used when ScaleMode is ScaleWithScreenSize.

public Dictionary<float,Vector2Int> AspectRatioLayouts;

Field Value

System.Collections.Generic.Dictionary<System.Single,UnityEngine.Vector2Int>

Configuration.Bindings Field

Per-feature input bindings (navigation, textbox, console, debugger) the UI reads. Leave any field null to fall back to Interlude.Tick.InputBindings.Default. Can also be replaced wholesale at runtime via SetBindings(InputBindings).

public InputBindings Bindings;

Field Value

InputBindings

Configuration.DpiSource Field

Where the DPI used by ConstantPhysicalSize is read from. Defaults to UnityEngine.Screen.dpi; tests can substitute a stub.

public IDpiSource DpiSource;

Field Value

IDpiSource

Configuration.FallbackDpi Field

The DPI to assume when UnityEngine.Screen.dpi reports 0 (some platforms don't expose it). Used when ScaleMode is ConstantPhysicalSize.

public float FallbackDpi;

Field Value

System.Single

Configuration.ReferenceDpi Field

The DPI the layout was authored against, used when ScaleMode is ConstantPhysicalSize. 96 is the standard desktop PPI; mobile authoring often targets 160.

public float ReferenceDpi;

Field Value

System.Single

Configuration.Scale Field

Global UI-scale multiplier applied on top of the active ScaleMode. 1.0 = native, 1.5 = 150% larger on screen, 0.75 = 75%. Folds into the layout-to-screen conversion in UI.Layout.RefreshScaleCache so every rect, font and gap grows or shrinks uniformly.

Values ≤ 0 are treated as 1.0, matching how FallbackDpi handles its "unset" sentinel. Useful for 4K HUDs in ConstantPixelSize where a 100-px button is otherwise readable but tiny - set 1.5 or 2.0 to compensate without changing any layout code.

public float Scale;

Field Value

System.Single

Configuration.ScaleMode Field

How layout-space pixels map to screen pixels. Default is ScaleWithScreenSize which preserves the existing per-aspect-ratio behaviour.

public ScaleMode ScaleMode;

Field Value

ScaleMode

Methods

Configuration.GetReferenceResolution() Method

Returns the layout reference resolution for the current screen size and ScaleMode. Result is cached per screen resolution for ScaleWithScreenSize.

public Vector2Int GetReferenceResolution();

Returns

UnityEngine.Vector2Int

Configuration.GetReferenceResolution(int, int) Method

Returns the layout reference resolution for the given frame size and ScaleMode. The UI scales relative to the frame it renders into (the size passed to BeginFrame), not the global screen — identical in normal use, and correct for off-screen render targets. Result is cached per frame size for ScaleWithScreenSize.

public Vector2Int GetReferenceResolution(int screenWidth, int screenHeight);

Parameters

screenWidth System.Int32

screenHeight System.Int32

Returns

UnityEngine.Vector2Int

Configuration.GetReferenceToScreenRatio() Method

Returns the per-axis ratio of screen pixels to layout pixels, used to convert between coordinate spaces.

public Vector2 GetReferenceToScreenRatio();

Returns

UnityEngine.Vector2

Configuration.GetReferenceToScreenRatio(int, int) Method

Per-axis ratio of frame pixels to layout pixels for an explicit frame size.

public Vector2 GetReferenceToScreenRatio(int screenWidth, int screenHeight);

Parameters

screenWidth System.Int32

screenHeight System.Int32

Returns

UnityEngine.Vector2

Configuration.ResolveScale() Method

Returns Scale with the "≤ 0 means unset" sentinel resolved to 1.0. Read by UI.Layout.RefreshScaleCache.

public float ResolveScale();

Returns

System.Single