API Reference
CellBuffer
A grid of Cell values: the frame every widget renders into. Writing keeps wide graphemes consistent (a wide grapheme that would be split by the right edge or overwritten by half is replaced by blanks). Not thread-safe: a buffer belongs to one render pass.
Inheritance
- Object
- CellBuffer
Usage
Explore 32 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 12
- Property Region.Buffer
- Method ConsoleExporter.Render
- Method ScreenCapture.FindFrame
- Property ScreenCapture.Frames
- Property ScreenCapture.LastFrame
- Property LivePause.Backdrop
- Method LiveSession.Snapshot
- Method FrameComposer.Compose
- Method FrameComposer.RenderBlock
- Method Terminal.Render
- Method Terminal.RenderChunks
- Method TestTerminal.Render
Accepted by parameters 20
- Method CellBuffer.Blit
- Method CellBuffer.CopyFrom
- Method FrameDiff.Compute
- Method FrameDiff.Compute
- Constructor Region.Region
- Method ConsoleExporter.Export
- Method ConsoleExporter.ToHtml
- Method ConsoleExporter.ToSvg
- Method ConsoleExporter.ToText
- Method InlineArea.Draw
- Method LivePause.Present
- Method FrameComposer.Compose
- Method InlineOutput.RenderFrame
- Method InlineOutput.WriteBlock
- Method ITerminalOutput.RenderFrame
- Method ITerminalOutput.WriteBlock
- Method LineOutput.RenderFrame
- Method LineOutput.WriteBlock
- Method VtOutput.RenderFrame
- Method VtOutput.WriteBlock
Constructors
public CellBuffer(Int32 width, Int32 height) #Creates a blank buffer.
Parameters
- width System.Int32
- Width in cells (at least 0).
- height System.Int32
- Height in cells (at least 0).
Methods
public Void Blit(CellBuffer source, Int32 sourceX, Int32 sourceY, Int32 width, Int32 height, Int32 targetX, Int32 targetY) #VoidCopies a region of another buffer into this one.
Parameters
- source ConsoleMonster.Canvas.CellBuffer
- The source buffer.
- sourceX System.Int32
- Source column.
- sourceY System.Int32
- Source row.
- width System.Int32
- Columns to copy.
- height System.Int32
- Rows to copy.
- targetX System.Int32
- Target column.
- targetY System.Int32
- Target row.
public Void Clear(Style style = default) #VoidResets every cell to a blank with the given style.
Parameters
- style ConsoleMonster.Styling.Style = default
- The fill style.
public Void CopyFrom(CellBuffer source) #VoidCopies another buffer of the same size into this one.
Parameters
- source ConsoleMonster.Canvas.CellBuffer
- The source buffer.
public String GetRowText(Int32 y) #StringReturns a row as plain text (continuation cells skipped, trailing spaces kept).
Parameters
- y System.Int32
- Row.
Returns
The row text.
public Void Resize(Int32 width, Int32 height) #VoidResizes the buffer, clearing its content.
Parameters
- width System.Int32
- New width.
- height System.Int32
- New height.
public Void Set(Int32 x, Int32 y, String glyph, Style style, Int32 width = 1) #VoidPlaces one grapheme. Wide graphemes that do not fit at the right edge become a blank.
Parameters
- x System.Int32
- Column.
- y System.Int32
- Row.
- glyph System.String
- The grapheme.
- style ConsoleMonster.Styling.Style
- The style.
- width System.Int32 = 1
- Grapheme width (1 or 2); 0 or less measures the glyph.
public Void SetStyle(Int32 x, Int32 y, Style style) #VoidChanges only the style of a cell, keeping its glyph.
Parameters
- x System.Int32
- Column.
- y System.Int32
- Row.
- style ConsoleMonster.Styling.Style
- The new style.
public String ToPlainText() #StringReturns the whole buffer as plain text lines with trailing spaces trimmed (used by snapshot tests).
Returns
The text, rows separated by \n.
public Int32 Write(Int32 x, Int32 y, String text, Style style, Int32 maxX = 2147483647) #Int32Writes text from a position, clipped at maxX (exclusive).
Parameters
- x System.Int32
- Start column.
- y System.Int32
- Row.
- text System.String
- The text (single line).
- style ConsoleMonster.Styling.Style
- The style.
- maxX System.Int32 = 2147483647
- Exclusive right clip edge; defaults to the buffer width.
Returns
The column after the last written cell.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Cell this[Int32 x, Int32 y] { get; } #Gets the cell at a position (blank when out of range).
Parameters
- x System.Int32
- Column.
- y System.Int32
- Row.