Interface ITextModeRenderSource
A TextMode view whose grid can be rendered somewhere other than its own place on screen, for example into a render texture by TextModeGridCapture.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public interface ITextModeRenderSource : ITextModeGridProvider
Remarks
Both UITextModeView and TextModeView implement it. The view keeps owning the grid, the GPU cell buffer, the font atlas and all input. A capture reads the same cell buffer the view uploads every frame, so no cell data is copied.
A component that shows the grid in another form, such as the CRT, sets DrawSelf to false so the plain grid does not also appear on screen.
Properties
CellBorder
Gets the frame of border cells the view lays out around its content grid, which Columns and Rows do not include. None when the view has no border.
Declaration
TextModeCellBorder CellBorder { get; }
Property Value
| Type | Description |
|---|---|
| TextModeCellBorder |
Remarks
A capture shows the whole full grid: the content cells surrounded by border cells in the view's default background. A pointer mapper's grid position covers the padded grid too.
DrawSelf
Gets or sets whether the view draws its grid itself. Defaults to true.
Declaration
bool DrawSelf { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
When false, the view draws nothing, but it keeps uploading cells, running effects, blinking the cursor and handling input and selection. Set it back to true when the component that took over the drawing goes away.
PointerMapper
Gets or sets the mapper that converts screen points to grid positions, or null to use the view's own on-screen area. Defaults to null.
Declaration
ITextModePointerMapper PointerMapper { get; set; }
Property Value
| Type | Description |
|---|---|
| ITextModePointerMapper |
Remarks
A component that shows the grid somewhere else, or distorted, installs a mapper so that ScreenPointToCell(Vector2, Camera, out CellPosition) and everything built on it (selection, mouse reporting, hyperlink clicks) hit the cell under the pointer. It sets the property back to null when it goes away.
SRGBCorrection
Gets whether the view converts cell colors from sRGB to linear when shading, which is what a Linear color space project needs.
Declaration
bool SRGBCorrection { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
TryWriteCellProperties(MaterialPropertyBlock)
Writes everything a cell shader needs to shade this view's grid into a property block: the cell buffer, the grid size, the border and its color, the font atlas, the SDF, cursor and selection settings and the current blink phases.
Declaration
bool TryWriteCellProperties(MaterialPropertyBlock block)
Parameters
| Type | Name | Description |
|---|---|---|
| MaterialPropertyBlock | block | The property block to write into. Existing values are overwritten. |
Returns
| Type | Description |
|---|---|
| bool | True if the view is initialized and the block holds a complete set of properties. |
Remarks
The cell size is not written, because it depends on the target. The caller sets
_CellSize itself.