Skip to content

Class TerminalRenderer

Draws an emulator’s screen into a RenderTexture sized exactly cols * cellWidth by rows * cellHeight. Every quad lands on integer pixels and the atlas is sampled texel for texel, which is what keeps the glyphs free of subpixel shimmer. Display styling happens later, in the screen shader of whatever presents the texture.

Declaration
public sealed class TerminalRenderer
Declaration
public RenderTexture Target { get; }
Declaration
public TerminalEmulator Emulator { get; }

Rows scrolled back into history. 0 shows the live screen.

Declaration
public int ScrollOffset { get; set; }

The selected cells, rows relative to the live screen top (negative rows reach scrollback). Null when nothing is selected.

Declaration
public CellRange? Selection { get; set; }

A cell surface to draw in place of the emulator’s screen, for a surface program. It shows with no cursor, selection, or scrollback. Null draws the emulator.

Declaration
public CellSurface Surface { get; set; }
Declaration
public int CellWidth { get; }
Declaration
public int CellHeight { get; }

The cell size in pixels the glyphs are rasterized at.

Declaration
public int FontSize { get; }
Declaration
public TerminalRenderer.Overlay AddOverlay(Texture texture, RectInt cellRect)

DarkEffekt.Terminal.Unity.TerminalRenderer.Overlay

Type Name
UnityEngine.Texture texture
UnityEngine.RectInt cellRect
Declaration
public void RemoveOverlay(TerminalRenderer.Overlay overlay)
Type Name
DarkEffekt.Terminal.Unity.TerminalRenderer.Overlay overlay

Marks the next Render call dirty, for overlay edits and theme changes.

Declaration
public void SetDirty()

Places the hover indicator on a cell. PointerIndicator.None clears it.

Declaration
public void SetPointer(int col, int row, PointerIndicator style)
Type Name
System.Int32 col
System.Int32 row
DarkEffekt.Terminal.Unity.PointerIndicator style
Declaration
public void ClearPointer()

Call once per frame. Redraws only when something changed, and only the rows that did.

Declaration
public void Render(float time)
Type Name
System.Single time

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Raised after each redraw, with the target bound state already restored. Paint anything extra into the texture here.

Declaration
public event Action<RenderTexture> AfterRender

System.Action<UnityEngine.RenderTexture>

Raised when the target texture is recreated after a resize.

Declaration
public event Action<RenderTexture> TargetChanged

System.Action<UnityEngine.RenderTexture>