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 AmbientEffectBase

    Base class for effects that decorate whatever is already on screen and keep going, rather than moving a region from one state to another and finishing.

    Inheritance
    object
    TextEffectBase
    AmbientEffectBase
    ColorCycleEffect
    FlickerEffect
    GlitchEffect
    PulseEffect
    TwinkleEffect
    WaveEffect
    Implements
    ITextEffect
    IDisposable
    Inherited Members
    TextEffectBase.Name
    TextEffectBase.State
    TextEffectBase.IsRunning
    TextEffectBase.IsComplete
    TextEffectBase.Progress
    TextEffectBase.Region
    TextEffectBase.RequestedRegion
    TextEffectBase.Duration
    TextEffectBase.Delay
    TextEffectBase.Speed
    TextEffectBase.Ease
    TextEffectBase.TimeMode
    TextEffectBase.Loops
    TextEffectBase.PingPong
    TextEffectBase.CompletedLoops
    TextEffectBase.Seed
    TextEffectBase.Mask
    TextEffectBase.CellDuration
    TextEffectBase.Context
    TextEffectBase.ResolvedRegion
    TextEffectBase.EasedProgress
    TextEffectBase.DeltaSinceLastTick
    TextEffectBase.OnStarted
    TextEffectBase.OnCompleted
    TextEffectBase.OnStopped
    TextEffectBase.Start()
    TextEffectBase.Stop()
    TextEffectBase.Skip()
    TextEffectBase.Pause()
    TextEffectBase.Resume()
    TextEffectBase.Tick(float)
    TextEffectBase.Dispose()
    TextEffectBase.OnEffectTick(float, float)
    TextEffectBase.TryPutChar(int, int, uint, Color32, Color32, CellAttributes)
    TextEffectBase.TryWriteCell(int, int, in Cell)
    TextEffectBase.EnsureThresholds()
    TextEffectBase.ReleaseThresholds()
    TextEffectBase.CellProgress(float, int, int)
    TextEffectBase.ResolveDrawableGlyphs(string)
    TextEffectBase.CellThreshold(int, int)
    TextEffectBase.TryReadCell(int, int, out Cell)
    TextEffectBase.MarkRegionDirty()
    TextEffectBase.WarnIfMaskIsIgnored()
    TextEffectBase.SetDefaultMask(in CellMask)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.TextMode
    Assembly: ScyllaTextMode.dll
    Syntax
    public abstract class AmbientEffectBase : TextEffectBase, ITextEffect, IDisposable
    Remarks

    An ambient effect captures its region when it starts and then draws a modified version of that capture every frame. The original is never lost, so the effect can put it back when it stops, which is what lets a glitch or a flicker be switched off without the screen underneath having to be redrawn.

    These effects repeat without end by default, so nothing chained to their completion will run. That is deliberate: an ambient effect is meant to carry on until whatever it is decorating goes away. Give one a loop count if it should stop on its own.

    Because they run for a long time, the rule that an effect owns its region matters more here than anywhere else. An ambient effect keeps drawing from the copy it took at the start, so content drawn into the region afterwards is liable to be overwritten. Call Refresh() right after redrawing to bring the effect up to date.

    Do not rely on that overwrite happening promptly, or at all. Only the effects that rewrite the whole region every tick reclaim it on the next frame. The ones that skip redundant writes reclaim a cell whenever they next happen to touch it, which for a flicker or a glitch is the next time its timer fires, and for a twinkle is whenever a point lands on that cell, possibly never. Foreign content can therefore sit in the region indefinitely, looking as though it were part of the effect.

    Constructors

    AmbientEffectBase()

    Creates an ambient effect, which repeats without end until it is given a loop count.

    Declaration
    protected AmbientEffectBase()

    Properties

    Content

    Gets the untouched region the effect decorates. Valid from OnAmbientStart() onward.

    Declaration
    protected CellBuffer Content { get; }
    Property Value
    Type Description
    CellBuffer

    RestoreOnFinish

    Gets or sets whether the region is put back the way it was when the effect stops.

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

    On by default, because an ambient effect is a decoration and switching it off should leave no trace. Turn it off when the caller is going to redraw the region anyway, to save a pass over it.

    Methods

    OnAmbientFinish(bool)

    Called when the effect stops, before the untouched content is put back.

    Declaration
    protected virtual void OnAmbientFinish(bool completed)
    Parameters
    Type Name Description
    bool completed

    True when the effect ran out its loops rather than being stopped.

    OnAmbientRefresh()

    Called when the region is captured again through Refresh().

    Declaration
    protected virtual void OnAmbientRefresh()

    OnAmbientStart()

    Called when the effect starts, after the region has been captured.

    Declaration
    protected virtual void OnAmbientStart()

    OnEffectFinish(bool)

    Called when the effect finishes, whether it completed, was skipped or was stopped.

    Declaration
    protected override sealed void OnEffectFinish(bool completed)
    Parameters
    Type Name Description
    bool completed

    True when the effect reached its final state.

    Overrides
    TextEffectBase.OnEffectFinish(bool)
    Remarks

    The default implementation does nothing. Override it to restore state an effect borrowed, which is what a corrupting effect needs so the grid is not left damaged.

    OnEffectRelease()

    Called when the effect is disposed. Return anything rented from the context here.

    Declaration
    protected override void OnEffectRelease()
    Overrides
    TextEffectBase.OnEffectRelease()

    OnEffectStart()

    Called when the effect starts, after the region is resolved and before any tick. Capture whatever the effect needs from the grid here.

    Declaration
    protected override sealed void OnEffectStart()
    Overrides
    TextEffectBase.OnEffectStart()

    Refresh()

    Takes a fresh copy of the region, so the effect decorates what is on screen now.

    Declaration
    public void Refresh()
    Remarks

    Call this immediately after redrawing a region an ambient effect is running on, and not at any other time. The screen normally shows the decorated version, so refreshing at any other moment captures the decoration and bakes it in.

    Implements

    ITextEffect
    IDisposable

    Extension Methods

    TextEffectExtensions.OnComplete<T>(T, Action)
    TextEffectExtensions.OnStart<T>(T, Action)
    TextEffectExtensions.OnStop<T>(T, Action)
    TextEffectExtensions.SetCellDuration<T>(T, float)
    TextEffectExtensions.SetDelay<T>(T, float)
    TextEffectExtensions.SetDuration<T>(T, float)
    TextEffectExtensions.SetEase<T>(T, EaseType)
    TextEffectExtensions.SetFullGrid<T>(T)
    TextEffectExtensions.SetLoops<T>(T, int, bool)
    TextEffectExtensions.SetMask<T>(T, in CellMask)
    TextEffectExtensions.SetName<T>(T, string)
    TextEffectExtensions.SetRegion<T>(T, in CellRect)
    TextEffectExtensions.SetRegion<T>(T, int, int, int, int)
    TextEffectExtensions.SetSeed<T>(T, int)
    TextEffectExtensions.SetSpeed<T>(T, float)
    TextEffectExtensions.SetTimeMode<T>(T, TextEffectTimeMode)
    In this article
    Back to top Scylla Framework - TextMode Module API Documentation