Interface ITextModeGridProvider
Interface abstracting the shared API of text mode view types (TextModeView and UITextModeView). Used by TextModeSelectionManager and the text effects system to work with either view type.
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public interface ITextModeGridProvider
Properties
CellSize
Gets the computed cell size in the view's coordinate space.
Declaration
Vector2 CellSize { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Columns
Gets the number of columns in the grid.
Declaration
int Columns { get; }
Property Value
| Type | Description |
|---|---|
| int |
Effects
Gets the effect player for this view, creating it on first access.
Declaration
TextModeEffectPlayer Effects { get; }
Property Value
| Type | Description |
|---|---|
| TextModeEffectPlayer |
Remarks
The player is created lazily, so a view that never runs an effect never allocates one. Once it exists the view advances it every frame, immediately before uploading the grid to the GPU.
GlyphCache
Gets the glyph cache holding the packed atlas data for this view's font.
Declaration
GlyphAtlasCache GlyphCache { get; }
Property Value
| Type | Description |
|---|---|
| GlyphAtlasCache |
Grid
Gets the cell grid for reading and writing cell data.
Declaration
CellGrid Grid { get; }
Property Value
| Type | Description |
|---|---|
| CellGrid |
IsInitialized
Gets whether the view is initialized and ready for use.
Declaration
bool IsInitialized { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Rows
Gets the number of rows in the grid.
Declaration
int Rows { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
ApplyTheme(in TextModeColorScheme)
Applies a color theme to this view, replacing the default foreground and background, the cursor color and the selection color with the theme's.
Declaration
void ApplyTheme(in TextModeColorScheme scheme)
Parameters
| Type | Name | Description |
|---|---|---|
| TextModeColorScheme | scheme | The resolved theme colors to apply. |
Remarks
This changes what the view writes and clears with from now on. Text already on the grid keeps the colors it was written with, because every cell stores its own; pass the grid to TextModeThemeRemapper as well to retint it.
ScreenPointToCell(Vector2, Camera, out CellPosition)
Converts a screen point to a cell position in the grid.
Declaration
bool ScreenPointToCell(Vector2 screenPoint, Camera eventCamera, out CellPosition cellPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | screenPoint | Screen-space point (e.g. from |
| Camera | eventCamera | Camera used for the conversion. For world-space views this is the rendering camera; for UI views this is the canvas event camera (null for screen-space overlay). |
| CellPosition | cellPosition | The resulting cell position if the point is within the grid. |
Returns
| Type | Description |
|---|---|
| bool | True if the screen point maps to a valid cell in the grid. |