Skip to content

Class TerminalViewportFitter

Fills a viewport with a terminal by reflowing its grid, the way a real terminal resizes when its window changes. It shows the three sizes the package keeps separate:

  • cell size in device pixels, from a point size scaled by DPI, which sets the render resolution,
  • columns and rows, computed so the grid fills the viewport at that cell size,
  • the display size, the viewport the texture is stretched across. With DPI scaling on, cells keep a constant physical size and the column and row counts change with the display, which is what the reflow shows.
Declaration
[AddComponentMenu("Terminal/Terminal Viewport Fitter")]
[RequireComponent(typeof(RectTransform))]
[Icon("Packages/com.darkeffekt.terminal/Editor/Icons/Assets/TerminalViewportFitter.png")]
public sealed class TerminalViewportFitter : MonoBehaviour

Inheritance: System.Object -> UnityEngine.Object -> UnityEngine.Component -> UnityEngine.Behaviour -> UnityEngine.MonoBehaviour

Declaration
public TerminalSession Session { get; set; }
Declaration
public TerminalScreenUGUI FlatScreen { get; set; }

The reference point size before DPI scaling. Set to demonstrate render-size control.

Declaration
public float CellPointSize { get; set; }
Declaration
public bool DpiScaling { get; set; }
Declaration
public float DpiOverride { get; set; }

The DPI scale actually applied this frame.

Declaration
public float ActiveDpiScale { get; }
Declaration
public int Columns { get; }
Declaration
public int Rows { get; }
Declaration
public int CellPixelHeight { get; }

A one-line summary of the three sizes, for a status readout.

Declaration
public string Describe()

System.String