API Reference
Region
The rectangle a widget renders into: a clipped view onto a CellBuffer with local coordinates. Writes outside the region are discarded, so a widget can never draw over its neighbours.
Inheritance
- Object
- Region
Usage
Explore 58 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 1
- Method Region.Sub
Accepted by parameters 57
- Method BrailleCanvas.Render
- Method CharacterCanvas.Render
- Method HalfBlockCanvas.Render
- Method PixelCanvas.Render
- Method ChangeView.Render
- Method Align.Render
- Method Columns.Render
- Method CultureScope.Render
- Method Grid.Render
- Method ICompactWidget.RenderCompact
- Method IWidget.Render
- Method Padding.Render
- Method Panel.Render
- Method Prioritized.Render
- Method Rows.Render
- Method Sized.Render
- Method Stack.Render
- Method WatchFrame.Render
- Method TestRunSummary.Render
- Method TestRunView.Render
- Method RichText.Render
- Method ActivityList.Render
- Method BarChart.Render
- Method CellMap.Render
- Method CodeView.Render
- Method Dashboard.Render
- Method Dashboard.RenderCompact
- Method ExceptionView.Render
- Method FooterBar.Render
- Method HeaderBar.Render
- Method HelpView.Render
- Method Histogram.Render
- Method InspectorView.Render
- Method KeyValueList.Render
- Method Lanes.Render
- Method LineChart.Render
- Method LiveTable.Render
- Method LiveWidget.Render
- Method Logo.Render
- Method LogRegion.Render
- Method Phases.Render
- Method ProgressBar.Render
- Method ProgressColumn.Draw
- Method RecordView.Render
- Method Rule.Render
- Method RunView.Render
- Method Slot.Render
- Method Sparkline.Render
- Method Spinner.Render
- Method StackedBar.Render
- Method StatusList.Render
- Method SummaryBar.Render
- Method Table.Render
- Method Table.Render
- Method TextBlock.Render
- Method Tree.Render
- Method WatchView.Render
Constructors
public Region(CellBuffer buffer, Rect bounds) #Creates a region covering part of a buffer.
Parameters
- buffer ConsoleMonster.Canvas.CellBuffer
- The buffer.
- bounds ConsoleMonster.Canvas.Rect
- The absolute rectangle (clipped to the buffer).
public Region(CellBuffer buffer) #Creates a region covering a whole buffer.
Parameters
- buffer ConsoleMonster.Canvas.CellBuffer
- The buffer.
Methods
public Void Fill(Int32 x, Int32 y, Int32 width, Int32 height, String glyph, Style style) #VoidFills a local rectangle with a glyph.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- width System.Int32
- Width.
- height System.Int32
- Height.
- glyph System.String
- The glyph.
- style ConsoleMonster.Styling.Style
- The style.
public Void Fill(Style style) #VoidFills the whole region with blanks in a style (for example a header bar background).
Parameters
- style ConsoleMonster.Styling.Style
- The style.
public Cell Get(Int32 x, Int32 y) #CellReads a cell at a local position.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
Returns
The cell (blank when outside).
public Void HorizontalLine(Int32 x, Int32 y, Int32 count, String glyph, Style style) #VoidRepeats a glyph horizontally.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- count System.Int32
- Number of cells.
- glyph System.String
- The glyph.
- style ConsoleMonster.Styling.Style
- The style.
public Void Put(Int32 x, Int32 y, String glyph, Style style, Int32 width = 1) #VoidPlaces one grapheme at a local position.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- glyph System.String
- The grapheme.
- style ConsoleMonster.Styling.Style
- The style.
- width System.Int32 = 1
- Grapheme width (1 or 2), or 0 to measure.
public Void SetStyle(Int32 x, Int32 y, Style style) #VoidChanges the style of a cell, keeping its glyph.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- style ConsoleMonster.Styling.Style
- The style.
public Region Sub(Int32 x, Int32 y, Int32 width, Int32 height) #RegionReturns a child region in local coordinates, clipped to this region.
Parameters
- x System.Int32
- Local left column.
- y System.Int32
- Local top row.
- width System.Int32
- Width.
- height System.Int32
- Height.
Returns
The child region.
public Void VerticalLine(Int32 x, Int32 y, Int32 count, String glyph, Style style) #VoidRepeats a glyph vertically.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- count System.Int32
- Number of cells.
- glyph System.String
- The glyph.
- style ConsoleMonster.Styling.Style
- The style.
public Int32 Write(Int32 x, Int32 y, String text, Style style, Int32 maxWidth = -1) #Int32Writes single-line text at a local position, clipped to the region (and to maxWidth).
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- text System.String
- The text.
- style ConsoleMonster.Styling.Style
- The style.
- maxWidth System.Int32 = -1
- Maximum cells to use, or -1 for the rest of the row.
Returns
The local column after the text.
public Int32 Write(Int32 x, Int32 y, StyledLine line, Int32 maxWidth = -1, Style baseStyle = default) #Int32Writes a styled line at a local position, clipped to the region.
Parameters
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- line ConsoleMonster.Text.StyledLine
- The line.
- maxWidth System.Int32 = -1
- Maximum cells to use, or -1 for the rest of the row.
- baseStyle ConsoleMonster.Styling.Style = default
- A style layered underneath every span.
Returns
The local column after the text.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?