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 TicTacToeScreen

    A game of tic-tac-toe played inside the debug console, as a worked example of a full screen taking over the console grid.

    Inheritance
    object
    TicTacToeScreen
    Implements
    IConsoleScreen
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.Console.TextMode
    Assembly: ScyllaTextMode.ConsoleDisplay.dll
    Syntax
    public sealed class TicTacToeScreen : IConsoleScreen
    Remarks

    The player is X and moves first, the computer is O. Empty squares show the digit that claims them, laid out like a numeric keypad, so 7 is the top left and 3 the bottom right. Q leaves the game and gives the console back, and R starts a new game.

    Everything is drawn in the console's own text color. A screen cannot know whether the console is themed light or dark, so a fixed palette risks marks that disappear into the background; monochrome follows whatever theme is loaded.

    What this demonstrates, beyond the game: a screen owns every cell and draws straight into the grid it is handed, reads the keyboard itself because the console suspends its command line, redraws only when something changes rather than every frame, and hands the console back with its log and scroll position intact.

    Properties

    IsFinished

    Gets whether the screen has finished and wants the console back.

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

    true once the screen is done. The console checks this after every OnUpdate(float) and closes the screen on the same frame it turns true, so a screen never has to close itself.

    Methods

    OnClose()

    Called once as the screen closes, whether it finished on its own or the console took it down.

    Declaration
    public void OnClose()
    Remarks

    The console closes an open screen when it is hidden or destroyed, so this is the place to release anything the screen holds. The grid handed to OnOpen(UITextModeView, DebugConsoleColorScheme) must not be touched after this returns.

    OnOpen(UITextModeView, DebugConsoleColorScheme)

    Called once as the screen opens, handing it the grid it draws into.

    Declaration
    public void OnOpen(UITextModeView view, DebugConsoleColorScheme colors)
    Parameters
    Type Name Description
    UITextModeView view

    The view the console has switched onto its alternate grid. Its Rows and Columns are whatever the console is currently sized to, so a screen should lay itself out from those rather than assume a size. The grid arrives holding whatever a previous screen left in it; clear it through Grid if a blank start matters.

    DebugConsoleColorScheme colors

    The console's current theme. Draw from these rather than from fixed colors: the console is themed by palette and a project may well be running a light one, where hard-coded white text would be invisible.

    Remarks

    Draw through SetCell(int, int, uint, Color32, Color32, CellAttributes) rather than writing to the grid directly. The view looks the glyph up in the font atlas and stamps its texture coordinates into the cell; a cell written straight to the grid carries a codepoint with no atlas data behind it, and renders as a blank block of background.

    Pass DefaultBackground as the cell background unless a block of color is actually wanted. The console sets that fully transparent so its gradient shows through the text, and an opaque background stamps a flat rectangle over the gradient behind every character drawn.

    The theme is handed over once, as the screen opens. A screen that outlives a live theme change keeps the colors it was given until it is reopened.

    OnUpdate(float)

    Called once per frame while the screen is open, to read input and redraw.

    Declaration
    public void OnUpdate(float deltaTime)
    Parameters
    Type Name Description
    float deltaTime

    Seconds since the previous frame, scaled by the framework's time.

    Remarks

    The console does not redraw anything on a screen's behalf, so a screen that draws nothing shows the frame it last drew. That is a reasonable way to run: draw on change rather than every frame, since the grid keeps its contents.

    Implements

    IConsoleScreen

    See Also

    IConsoleScreen
    TicTacToeCommand
    In this article
    Back to top Scylla Framework - TextMode Module API Documentation