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.
Assembly: DarkEffekt.Terminal
Section titled “Assembly: DarkEffekt.Terminal”public sealed class TerminalRendererProperties
Section titled “Properties”Target
Section titled “Target”public RenderTexture Target { get; }Emulator
Section titled “Emulator”public TerminalEmulator Emulator { get; }ScrollOffset
Section titled “ScrollOffset”Rows scrolled back into history. 0 shows the live screen.
public int ScrollOffset { get; set; }Selection
Section titled “Selection”The selected cells, rows relative to the live screen top (negative rows reach scrollback). Null when nothing is selected.
public CellRange? Selection { get; set; }Surface
Section titled “Surface”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.
public CellSurface Surface { get; set; }CellWidth
Section titled “CellWidth”public int CellWidth { get; }CellHeight
Section titled “CellHeight”public int CellHeight { get; }FontSize
Section titled “FontSize”The cell size in pixels the glyphs are rasterized at.
public int FontSize { get; }Methods
Section titled “Methods”AddOverlay(Texture, RectInt)
Section titled “AddOverlay(Texture, RectInt)”public TerminalRenderer.Overlay AddOverlay(Texture texture, RectInt cellRect)Returns
Section titled “Returns”DarkEffekt.Terminal.Unity.TerminalRenderer.Overlay
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Texture |
texture |
UnityEngine.RectInt |
cellRect |
RemoveOverlay(Overlay)
Section titled “RemoveOverlay(Overlay)”public void RemoveOverlay(TerminalRenderer.Overlay overlay)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.Unity.TerminalRenderer.Overlay | overlay |
SetDirty()
Section titled “SetDirty()”Marks the next Render call dirty, for overlay edits and theme changes.
public void SetDirty()SetPointer(int, int, PointerIndicator)
Section titled “SetPointer(int, int, PointerIndicator)”Places the hover indicator on a cell. PointerIndicator.None clears it.
public void SetPointer(int col, int row, PointerIndicator style)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
col |
System.Int32 |
row |
| DarkEffekt.Terminal.Unity.PointerIndicator | style |
ClearPointer()
Section titled “ClearPointer()”public void ClearPointer()Render(float)
Section titled “Render(float)”Call once per frame. Redraws only when something changed, and only the rows that did.
public void Render(float time)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
time |
Dispose()
Section titled “Dispose()”Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()Events
Section titled “Events”AfterRender
Section titled “AfterRender”Raised after each redraw, with the target bound state already restored. Paint anything extra into the texture here.
public event Action<RenderTexture> AfterRenderEvent Type
Section titled “Event Type”System.Action<UnityEngine.RenderTexture>
TargetChanged
Section titled “TargetChanged”Raised when the target texture is recreated after a resize.
public event Action<RenderTexture> TargetChangedEvent Type
Section titled “Event Type”System.Action<UnityEngine.RenderTexture>