Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Console.TextMode
      • IConsoleScreen
      • TextModeDebugConsoleDisplay
      • TicTacToeCommand
      • TicTacToeScreen
    • Scylla.TextMode
      • ANSIAttributeParser
      • ANSIColor
      • ANSISGRAttributes
      • AmbientEffectBase
      • BackgroundBlendMode
      • BoxStyle
      • BoxStyleCharacters
      • BoxStyleCharacters.BoxChars
      • CRTSettings
      • Cell
      • CellAttributes
      • CellAttributesExtensions
      • CellBuffer
      • CellBufferRenderer
      • CellGrid
      • CellMask
      • CellPosition
      • CellRange
      • CellRect
      • ColorCycleEffect
      • ColorCycleEffectPreset
      • CrossFadeEffect
      • CursorStyle
      • DecodeEffect
      • DecodeEffectPreset
      • DigitalRainEffect
      • DigitalRainEffectPreset
      • EffectsSettings
      • FadeEffect
      • FadeEffectPreset
      • FlickerEffect
      • FlickerEffectPreset
      • GlitchEffect
      • GlitchEffectPreset
      • GlyphAtlasCache
      • GridSettings
      • IAutoCompleter
      • IInputHistory
      • ITextEffect
      • ITextEffectContext
      • ITextModeGridProvider
      • ITextModePointerMapper
      • ITextModeRenderSource
      • ITextModeViewHost
      • IVTParserHandler
      • InputHistory
      • MaskTransitionEffect
      • MouseEncodingMode
      • MouseTrackingMode
      • PackedGlyphData
      • PulseEffect
      • PulseEffectPreset
      • PushEffect
      • PushEffectPreset
      • SDFSettings
      • ScrollbackAttributeRun
      • ScrollbackLine
      • ScyllaTextMode
      • ScyllaTextMode.Meta
      • ScyllaTextModeConfiguration
      • SlideInEffect
      • SlideInEffectPreset
      • StaticTuneInEffect
      • StaticTuneInEffectPreset
      • TerminalCLI
      • TerminalEmulator
      • TerminalGridRenderer
      • TerminalInputEncoder
      • TerminalMouseButton
      • TerminalScrollbackBuffer
      • TerminalSettings
      • TextAlignment
      • TextEffectBase
      • TextEffectCompletedEvent
      • TextEffectDirection
      • TextEffectExtensions
      • TextEffectMaskPattern
      • TextEffectPreset
      • TextEffectPushMode
      • TextEffectSequencer
      • TextEffectStartedEvent
      • TextEffectState
      • TextEffectTimeMode
      • TextEffects
      • TextModeCellBorder
      • TextModeColorDefaults
      • TextModeColorScheme
      • TextModeColorSet
      • TextModeConfigurationChangedEvent
      • TextModeConsole
      • TextModeConstants
      • TextModeEffectPlayer
      • TextModeGridCapture
      • TextModeLayoutUtil
      • TextModeMaterials
      • TextModeMouseReporter
      • TextModeMouseReportingEvent
      • TextModeSelectionChangedEvent
      • TextModeSelectionEndedEvent
      • TextModeSelectionManager
      • TextModeSelectionStartedEvent
      • TextModeTerminal
      • TextModeTerminalColorTheme
      • TextModeTerminalHost
      • TextModeTerminalSettings
      • TextModeTerminalStartMode
      • TextModeThemeBackground
      • TextModeThemeChangedEvent
      • TextModeThemeRemapper
      • TextModeThemes
      • TextModeView
      • TextWrapMode
      • ThemeSettings
      • TransitionEffectBase
      • TransitionEffectPreset
      • TwinkleEffect
      • TwinkleEffectPreset
      • TypewriterCharacterRevealedEvent
      • TypewriterEffect
      • TypewriterEffectPreset
      • UITextModeView
      • VTParser
      • WaveEffect
      • WaveEffectPreset
    • Scylla.TextMode.CRT
      • CRTBeam
      • CRTBeamClock
      • CRTBeamScanDirection
      • CRTBeamStatus
      • CRTCalibrationPattern
      • CRTCurvatureShape
      • CRTGeometry
      • CRTHDR
      • CRTHDRDisplay
      • CRTHDRTarget
      • CRTHorizontalKernel
      • CRTImageRegion
      • CRTMaskType
      • CRTQualityTier
      • CRTScaleMode
      • CRTSignalStandard
      • CRTSignalType
      • ITextModeCRTCameraEffect
      • ITextModeCRTHDRDisplaySource
      • TextModeCRTBeam
      • TextModeCRTCalibration
      • TextModeCRTCameraEffects
      • TextModeCRTConstants
      • TextModeCRTDriver
      • TextModeCRTHDR
      • TextModeCRTImageRenderer
      • TextModeCRTMonitor
      • TextModeCRTPreset
      • TextModeCRTPresetRegistry
      • TextModeCRTScreen
      • TextModeCRTSettings
      • TextModeCRTTube
    • Scylla.TextMode.Editor
      • CellGridPreviewWidget
      • ColorPaletteWidget
      • ITextModeCRTCameraSetupProvider
      • ScyllaTextModeConfigurationEditor
      • ScyllaTextModeDependencyProvider
      • ScyllaTextModeEditor
      • ScyllaTextModeMenuItems
      • ScyllaTextModeShaderProvider
      • TextModeCRTCameraSetup
      • TextModeCRTCameraStatus
      • TextModeCRTDriverEditor
      • TextModeCRTMonitorEditor
      • TextModeCRTPresetEditor
      • TextModeCRTPresetGenerator
      • TextModeColorAssetGenerator
      • TextModeColorPaletteDefaults
      • TextModeTerminalHostEditor
      • TextModeThemeField
      • TextModeViewEditor
      • TextModeViewEditorBase
      • UITextModeViewEditor
    • Scylla.TextMode.URP
      • CRTQualityTierParameter
      • TextModeCRTInjectionPoint
      • TextModeCRTPresetParameter
      • TextModeCRTRendererFeature
      • TextModeCRTVolume

    Class TextModeView

    World-space MonoBehaviour component for rendering a text mode cell grid. Manages a CellGrid and CellBufferRenderer to display a fixed grid of character cells with SDF font rendering. Grid columns, rows, and cell dimensions are auto-computed from FontSize, PixelsPerUnit, and the view dimensions (ViewWidth/ViewHeight).

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    TextModeView
    Implements
    ITextModeRenderSource
    ITextModeGridProvider
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.didStart
    MonoBehaviour.didAwake
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.GetComponentIndex()
    Component.CompareTag(string)
    Component.CompareTag(TagHandle)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.transformHandle
    Component.gameObject
    Component.tag
    Object.GetEntityId()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsByType(Type)
    Object.FindObjectsByType(Type, FindObjectsInactive)
    Object.DontDestroyOnLoad(Object)
    Object.FindAnyObjectByType<T>()
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsByType<T>()
    Object.FindObjectsByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType(Type)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Scylla.TextMode
    Assembly: ScyllaTextMode.dll
    Syntax
    [ExecuteAlways]
    [DisallowMultipleComponent]
    [AddComponentMenu("Scylla/TextMode/TextMode View")]
    public class TextModeView : MonoBehaviour, ITextModeRenderSource, ITextModeGridProvider

    Properties

    CellBorder

    Gets the frame of border cells around the grid. The world-space view has no border, so this is always None.

    Declaration
    public TextModeCellBorder CellBorder { get; }
    Property Value
    Type Description
    TextModeCellBorder

    CellSize

    Gets the computed cell size in world units.

    Declaration
    public Vector2 CellSize { get; }
    Property Value
    Type Description
    Vector2

    CharSpacing

    Gets or sets the character spacing multiplier. 1.0 = natural advance width. Values below 1.0 pack characters tighter. Changing this recomputes the grid layout.

    Declaration
    public float CharSpacing { get; set; }
    Property Value
    Type Description
    float

    Columns

    Gets the auto-computed number of columns in the grid.

    Declaration
    public int Columns { get; }
    Property Value
    Type Description
    int

    CursorColor

    Gets or sets the cursor color.

    Declaration
    public Color CursorColor { get; set; }
    Property Value
    Type Description
    Color

    DefaultBackground

    Gets or sets the default background color used for empty cells, and for cells the grid fills when it is cleared or resized.

    Declaration
    public Color32 DefaultBackground { get; set; }
    Property Value
    Type Description
    Color32
    Remarks

    As with DefaultForeground, this affects future writes and clears only.

    DefaultForeground

    Gets or sets the default foreground color used for cells written without an explicit color, and for cells the grid fills when it is cleared or resized.

    Declaration
    public Color32 DefaultForeground { get; set; }
    Property Value
    Type Description
    Color32
    Remarks

    Setting this changes what future writes and clears use. It does not recolor cells that already hold a color, because every cell stores its own. Use TextModeThemeRemapper to retint existing content.

    DrawSelf

    Gets or sets whether the view draws its grid itself. Defaults to true.

    Declaration
    public bool DrawSelf { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    When false, the view skips its draw call, but it keeps uploading cells, running effects, blinking the cursor and handling selection. A component that shows the grid in another form, such as the CRT, turns it off and sets it back when it goes away. See ITextModeRenderSource.

    Effects

    Gets the effect player for this view, creating it the first time it is used.

    Declaration
    public TextModeEffectPlayer Effects { get; }
    Property Value
    Type Description
    TextModeEffectPlayer
    Remarks

    A view that never runs an effect never creates a player, so the cost of the effects system on an unused view is one null check per frame. Once created, the player is advanced in LateUpdate just before the grid is uploaded to the GPU, so effect writes reach the screen in the same frame they are computed.

    Returns null until the view is initialized, because effects need a grid to write into.

    FollowColorTheme

    Gets or sets whether this view adopts the active color theme when the theme changes.

    Declaration
    public bool FollowColorTheme { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Enabled by default, which is what makes a global theme switch repaint every view without the game redrawing anything. Turn it off for a view whose colors are owned by another system, so a theme change leaves them alone. The debug console is the case this exists for: it paints a transparent background so its own gradient shows through, and a theme would otherwise overwrite that with an opaque color.

    Turning this off suppresses only later theme changes. Colors already applied stay as they are, so set it before the first theme is applied when the view must never be retinted at all.

    FontAsset

    Gets or sets the TMP font asset used for glyph rendering. Setting a new font at runtime triggers a full re-initialization.

    Declaration
    public TMP_FontAsset FontAsset { get; set; }
    Property Value
    Type Description
    TMP_FontAsset

    FontSize

    Gets or sets the font size in logical pixels. Cell height = fontSize / pixelsPerUnit. Changing this recomputes the grid layout.

    Declaration
    public float FontSize { get; set; }
    Property Value
    Type Description
    float

    GlyphCache

    Gets the glyph atlas cache for stamping cells with glyph data.

    Declaration
    public GlyphAtlasCache GlyphCache { get; }
    Property Value
    Type Description
    GlyphAtlasCache

    Grid

    Gets the cell grid for reading and writing cell data.

    Declaration
    public CellGrid Grid { get; }
    Property Value
    Type Description
    CellGrid

    IsInitialized

    Gets whether the view is initialized and ready for rendering.

    Declaration
    public bool IsInitialized { get; }
    Property Value
    Type Description
    bool

    LineHeight

    Gets or sets the line height multiplier. 1.0 = natural line height. Values above 1.0 add vertical spacing between rows. Changing this recomputes the grid layout.

    Declaration
    public float LineHeight { get; set; }
    Property Value
    Type Description
    float
    Remarks

    Values below 1.0 pack the rows closer together without changing the size of the glyphs. The space a line does not use is given up first, so nothing is lost down to roughly 0.82; below that the glyphs reach into the rows above and below, which draw the overhanging parts rather than clipping them.

    Assigning this takes ownership of the value. Until then the view uses the default line height from the TextMode module configuration and follows it when the configuration changes, in the same way it follows the configured SDF settings.

    Material

    Gets the renderer material for direct shader property access.

    Declaration
    public Material Material { get; }
    Property Value
    Type Description
    Material

    PixelsPerUnit

    Gets or sets the pixels-per-unit conversion factor. Higher values produce smaller cells. Changing this recomputes the grid layout.

    Declaration
    public float PixelsPerUnit { get; set; }
    Property Value
    Type Description
    float

    PointerMapper

    Gets or sets the mapper that converts screen points to grid positions, or null to use the view's own area. Defaults to null. See PointerMapper.

    Declaration
    public ITextModePointerMapper PointerMapper { get; set; }
    Property Value
    Type Description
    ITextModePointerMapper

    Rows

    Gets the auto-computed number of rows in the grid.

    Declaration
    public int Rows { get; }
    Property Value
    Type Description
    int

    SRGBCorrection

    Gets or sets whether sRGB-to-linear correction is applied when unpacking cell colors. Enable for correct brightness in Linear color space. Default is true.

    Declaration
    public bool SRGBCorrection { get; set; }
    Property Value
    Type Description
    bool

    SelectionColor

    Gets or sets the background of selected cells.

    Declaration
    public Color SelectionColor { get; set; }
    Property Value
    Type Description
    Color
    Remarks

    Selected cells are drawn in SelectionTextColor on this color, in place of their own colors. The built-in themes pick the pair so a selection reads as inverse text.

    SelectionTextColor

    Gets or sets the text color of selected cells. See SelectionColor.

    Declaration
    public Color SelectionTextColor { get; set; }
    Property Value
    Type Description
    Color

    ViewHeight

    Gets or sets the view height in world units. Changing this recomputes the number of rows.

    Declaration
    public float ViewHeight { get; set; }
    Property Value
    Type Description
    float

    ViewWidth

    Gets or sets the view width in world units. Changing this recomputes the number of columns.

    Declaration
    public float ViewWidth { get; set; }
    Property Value
    Type Description
    float

    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
    public 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.

    Reinitialize()

    Forces a full re-initialization. Call if the font asset changes at runtime.

    Declaration
    public void Reinitialize()

    ResetCursorBlink()

    Replaces the active cell grid reference with an external grid. Used when a TerminalEmulator switches between primary and alternate screen buffers. The new grid must have the same dimensions as the current grid.

    Declaration
    public void ResetCursorBlink()

    ScreenPointToCell(Vector2, Camera, out CellPosition)

    Converts a screen point to a cell position in the grid. Performs a raycast from the screen point onto the grid's XY plane, then converts the world-space hit to local cell coordinates.

    Note: The cell coordinate calculation assumes the grid transform has uniform scale and no rotation. Non-uniform scale or rotation may produce incorrect cell positions.

    Declaration
    public bool ScreenPointToCell(Vector2 screenPoint, Camera eventCamera, out CellPosition cellPosition)
    Parameters
    Type Name Description
    Vector2 screenPoint

    Screen-space point (e.g. from Mouse.current.position).

    Camera eventCamera

    Camera used for the raycast.

    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.

    SetCell(int, int, uint, Color32, Color32, CellAttributes)

    Sets a cell at the specified position with glyph atlas stamping.

    Declaration
    public void SetCell(int row, int col, uint codepoint, Color32 fg, Color32 bg, CellAttributes attributes = CellAttributes.None)
    Parameters
    Type Name Description
    int row

    Row index.

    int col

    Column index.

    uint codepoint

    Unicode codepoint.

    Color32 fg

    Foreground color.

    Color32 bg

    Background color.

    CellAttributes attributes

    Cell attributes.

    SetGrid(CellGrid)

    Declaration
    public void SetGrid(CellGrid newGrid)
    Parameters
    Type Name Description
    CellGrid newGrid

    SetViewSize(float, float)

    Sets both view dimensions at once, triggering a single layout recomputation.

    Declaration
    public void SetViewSize(float width, float height)
    Parameters
    Type Name Description
    float width

    View width in world units.

    float height

    View height in world units.

    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
    public 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.

    Implements

    ITextModeRenderSource
    ITextModeGridProvider
    In this article
    Back to top Scylla Framework - TextMode Module API Documentation