Skip to content

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.

Declaration
public readonly struct CellCanvas
Declaration
public CellRect ClipRect { get; }

The same canvas, limited further to a rectangle.

Declaration
public CellCanvas Clip(CellRect rect)

DarkEffekt.Terminal.UI.CellCanvas

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.

Declaration
public int Put(int x, int y, int rune, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None)

System.Int32

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.

Declaration
public int Text(int x, int y, string text, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None, int maxWidth = 2147483647)

System.Int32

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.

Declaration
public int Text(CellRect rect, string text, TermColor fg, TermColor bg, in TextOptions options = default)

System.Int32

Type Name
DarkEffekt.Terminal.UI.CellRect rect
System.String text
DarkEffekt.Terminal.TermColor fg
DarkEffekt.Terminal.TermColor bg
DarkEffekt.Terminal.UI.TextOptions options

The width of a string in cells.

Declaration
public static int Measure(string text)

System.Int32

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.

Declaration
public void Fill(CellRect rect, int rune, TermColor fg, TermColor bg, CellAttrs attrs = CellAttrs.None)
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.

Declaration
public void HBar(int x, int y, int width, float fraction, TermColor fg, TermColor bg)
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.

Declaration
public void HBar(int x, int y, int width, float fraction, ColorRamp ramp, TermColor bg)
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.

Declaration
public void VBar(int x, int y, int height, float fraction, ColorRamp ramp, TermColor bg)
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.

Declaration
public void VBar(int x, int y, int height, float fraction, TermColor fg, TermColor bg)
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.

Declaration
public void Box(CellRect rect, TermColor fg, TermColor bg, string title = null)
Type Name
DarkEffekt.Terminal.UI.CellRect rect
DarkEffekt.Terminal.TermColor fg
DarkEffekt.Terminal.TermColor bg
System.String title