Class TerminalGridRenderer
Renders the visible portion of a TerminalScrollbackBuffer into a CellGrid. Handles line wrapping (word, character, or none, per the active TextWrapMode), scroll offset calculation, and per-line foreground coloring. Each scrollback line is wrapped to fit within the grid width, producing one or more visual rows.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public class TerminalGridRenderer
Constructors
TerminalGridRenderer(UITextModeView, Color32, Color32)
Creates a new TerminalGridRenderer.
Declaration
public TerminalGridRenderer(UITextModeView view, Color32 foregroundColor, Color32 backgroundColor)
Parameters
| Type | Name | Description |
|---|---|---|
| UITextModeView | view | The UITextModeView used for glyph stamping via SetCell. |
| Color32 | foregroundColor | |
| Color32 | backgroundColor | The default background color for cells. |
Methods
CalculateTotalVisualRows(TerminalScrollbackBuffer, int)
Calculates the total number of visual rows (wrapped lines) that the scrollback buffer would produce for the given column width.
Declaration
public int CalculateTotalVisualRows(TerminalScrollbackBuffer buffer, int columns)
Parameters
| Type | Name | Description |
|---|---|---|
| TerminalScrollbackBuffer | buffer | The scrollback buffer to measure. |
| int | columns | The number of columns available for wrapping. |
Returns
| Type | Description |
|---|---|
| int | The total number of visual rows. |
Render(TerminalScrollbackBuffer, CellGrid, int, int)
Renders scrollback lines from the buffer into the grid, starting from the given visual row scroll offset. Fills the specified number of visible rows.
Declaration
public void Render(TerminalScrollbackBuffer buffer, CellGrid grid, int scrollOffsetRows, int visibleRows)
Parameters
| Type | Name | Description |
|---|---|---|
| TerminalScrollbackBuffer | buffer | The scrollback buffer to render from. |
| CellGrid | grid | The cell grid to render into. |
| int | scrollOffsetRows | The visual row offset from the top of the buffer (0 = oldest). |
| int | visibleRows | The number of grid rows available for display. |
SetBackgroundColor(Color32)
Updates the background color used for rendered cells.
Declaration
public void SetBackgroundColor(Color32 color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color | The new background color. |
SetForegroundColor(Color32)
Updates the foreground color used for the padding cells that fill the rest of a row.
Declaration
public void SetForegroundColor(Color32 color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color | The new foreground color. |
Remarks
Text itself is colored per line from the scrollback, so this is what a theme change needs in order to reach the empty space around it.