Struct CellCanvas
What an element draws through: a DarkEffekt.Terminal.CellSurface and the rectangle it may touch. Coordinates are the surface’s own; anything outside the clip is dropped.
Assembly: DarkEffekt.Terminal.UI
Section titled “Assembly: DarkEffekt.Terminal.UI”public readonly struct CellCanvasProperties
Section titled “Properties”ClipRect
Section titled “ClipRect”public CellRect ClipRect { get; }Methods
Section titled “Methods”Clip(CellRect)
Section titled “Clip(CellRect)”The same canvas, limited further to a rectangle.
public CellCanvas Clip(CellRect rect)Returns
Section titled “Returns”DarkEffekt.Terminal.UI.CellCanvas
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.UI.CellRect | rect |
Put(int, int, int, TermColor, TermColor, CellAttrs)
Section titled “Put(int, int, int, TermColor, TermColor, CellAttrs)”Draws one code point. Returns the cells it is wide, drawn or not.
public int Put(int x, int y, int rune, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None)Returns
Section titled “Returns”System.Int32
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.Int32 |
rune |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
| DarkEffekt.Terminal.CellAttrs | attrs |
Text(int, int, string, TermColor, TermColor, CellAttrs, int)
Section titled “Text(int, int, string, TermColor, TermColor, CellAttrs, int)”Draws text on one row, up to a width in cells. Returns the cells it took.
public int Text(int x, int y, string text, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None, int maxWidth = 2147483647)Returns
Section titled “Returns”System.Int32
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.String |
text |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
| DarkEffekt.Terminal.CellAttrs | attrs |
System.Int32 |
maxWidth |
Text(CellRect, string, TermColor, TermColor, in TextOptions)
Section titled “Text(CellRect, string, TermColor, TermColor, in TextOptions)”Draws a block of text in a rectangle, a row for each line, set as the options say: wrapped, aligned, with attributes. Lines past the rectangle’s last row are left out. Returns the rows the whole text takes, drawn or not.
public int Text(CellRect rect, string text, TermColor fg, TermColor bg, in TextOptions options = default)Returns
Section titled “Returns”System.Int32
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.UI.CellRect | rect |
System.String |
text |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
| DarkEffekt.Terminal.UI.TextOptions | options |
Measure(string)
Section titled “Measure(string)”The width of a string in cells.
public static int Measure(string text)Returns
Section titled “Returns”System.Int32
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.String |
text |
Fill(CellRect, int, TermColor, TermColor, CellAttrs)
Section titled “Fill(CellRect, int, TermColor, TermColor, CellAttrs)”Fills a rectangle with one code point.
public void Fill(CellRect rect, int rune, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.UI.CellRect | rect |
System.Int32 |
rune |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
| DarkEffekt.Terminal.CellAttrs | attrs |
HBar(int, int, int, float, TermColor, TermColor)
Section titled “HBar(int, int, int, float, TermColor, TermColor)”Draws a bar along one row, filled from the left to a fraction of its width in eighths of a cell. The unfilled part takes the background color.
public void HBar(int x, int y, int width, float fraction, TermColor fg, TermColor bg)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.Int32 |
width |
System.Single |
fraction |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
HBar(int, int, int, float, ColorRamp, TermColor)
Section titled “HBar(int, int, int, float, ColorRamp, TermColor)”Draws a bar along one row as HBar does, each cell taking its color from a ramp along the bar’s whole length.
public void HBar(int x, int y, int width, float fraction, ColorRamp ramp, TermColor bg)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.Int32 |
width |
System.Single |
fraction |
| DarkEffekt.Terminal.ColorRamp | ramp |
| DarkEffekt.Terminal.TermColor | bg |
VBar(int, int, int, float, ColorRamp, TermColor)
Section titled “VBar(int, int, int, float, ColorRamp, TermColor)”Draws a bar in one column as VBar does, each cell taking its color from a ramp up the bar’s whole height.
public void VBar(int x, int y, int height, float fraction, ColorRamp ramp, TermColor bg)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.Int32 |
height |
System.Single |
fraction |
| DarkEffekt.Terminal.ColorRamp | ramp |
| DarkEffekt.Terminal.TermColor | bg |
VBar(int, int, int, float, TermColor, TermColor)
Section titled “VBar(int, int, int, float, TermColor, TermColor)”Draws a bar in one column, filled from the bottom row up to a fraction of its height in eighths of a cell. The top row is y.
public void VBar(int x, int y, int height, float fraction, TermColor fg, TermColor bg)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x |
System.Int32 |
y |
System.Int32 |
height |
System.Single |
fraction |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
Box(CellRect, TermColor, TermColor, string)
Section titled “Box(CellRect, TermColor, TermColor, string)”Draws a single-line box around a rectangle, with a title set into its top edge.
public void Box(CellRect rect, TermColor fg, TermColor bg, string title = null)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.UI.CellRect | rect |
| DarkEffekt.Terminal.TermColor | fg |
| DarkEffekt.Terminal.TermColor | bg |
System.String |
title |