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 TwinkleEffect

    Scatters points of light through the empty parts of a region, each fading up and back down on its own clock before moving somewhere else.

    Inheritance
    object
    TextEffectBase
    AmbientEffectBase
    TwinkleEffect
    Implements
    ITextEffect
    IDisposable
    Inherited Members
    AmbientEffectBase.RestoreOnFinish
    AmbientEffectBase.Refresh()
    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.OnStarted
    TextEffectBase.OnCompleted
    TextEffectBase.OnStopped
    TextEffectBase.Start()
    TextEffectBase.Stop()
    TextEffectBase.Skip()
    TextEffectBase.Pause()
    TextEffectBase.Resume()
    TextEffectBase.Tick(float)
    TextEffectBase.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.TextMode
    Assembly: ScyllaTextMode.dll
    Syntax
    public sealed class TwinkleEffect : AmbientEffectBase, ITextEffect, IDisposable
    Remarks

    Every point picks a blank cell, a glyph and a lifetime, brightens over the first half of that lifetime and dims over the second, then vanishes and starts again elsewhere. The lifetimes are staggered at the start, so the field is already mid-cycle on the first frame rather than pulsing in unison. The result is a slow shimmer that suits a title screen or a night sky behind menu text.

    Only cells that were empty when the effect started are used. Text in the region is left alone rather than twinkled over, which is what lets this run underneath a logo or a menu without touching it. A region with no empty cells produces nothing.

    Each point fades between the cell's own background and Color, so a dim color gives a subtle field and a bright one gives hard sparkles. Fully faded points are indistinguishable from the background they sit on.

    Cost is proportional to the number of points rather than to the size of the region: only cells holding a point are written, plus the one cell a point vacates when it moves.

    Properties

    Color

    Gets or sets the color a point reaches at the top of its fade. Defaults to the grid's foreground.

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

    Points fade between the background of the cell they sit on and this color, so the brightness of the field is set here. A color close to the background gives a shimmer that is barely there; a bright one gives sparkles that compete with the text.

    This is the peak, reached only at the middle of a point's life. Points spend the rest of it climbing to that or falling away from it, so the field averages about half of whatever is set here. Picking an already dim color on the reasoning that the field should be subtle halves it again and leaves nothing visible; start from the text color and come down from there.

    Density

    Gets or sets how much of the region's empty space is lit at any one moment, as a fraction of its blank cells. Defaults to 0.04, a sparse field.

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

    Expressed as a fraction rather than a count so the same setting looks the same on any region: a value that reads as a scattering on a full screen would be a snowstorm in a panel. At least one point is always placed while the region has room for one.

    GlyphSet

    Gets or sets the characters the points are drawn from. Characters the font cannot draw are dropped when the effect starts.

    Declaration
    public string GlyphSet { get; set; }
    Property Value
    Type Description
    string

    MaxLifetime

    Gets or sets the longest time a point lives before it moves elsewhere, in seconds.

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

    MinLifetime

    Gets or sets the shortest time a point lives before it moves elsewhere, in seconds.

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

    Methods

    OnAmbientRefresh()

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

    Declaration
    protected override void OnAmbientRefresh()
    Overrides
    AmbientEffectBase.OnAmbientRefresh()

    OnAmbientStart()

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

    Declaration
    protected override void OnAmbientStart()
    Overrides
    AmbientEffectBase.OnAmbientStart()

    OnEffectRelease()

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

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

    OnEffectTick(float, float)

    Called once per tick to draw the effect at the given progress.

    Declaration
    protected override void OnEffectTick(float progress, float easedProgress)
    Parameters
    Type Name Description
    float progress

    Linear progress from 0 to 1.

    float easedProgress

    Progress with the easing curve applied.

    Overrides
    TextEffectBase.OnEffectTick(float, float)

    SetColor(Color32)

    Sets the color a point reaches at the top of its fade.

    Declaration
    public TwinkleEffect SetColor(Color32 color)
    Parameters
    Type Name Description
    Color32 color

    The peak color.

    Returns
    Type Description
    TwinkleEffect

    This effect, for chaining.

    SetDensity(float)

    Sets how much of the region's empty space is lit at any one moment.

    Declaration
    public TwinkleEffect SetDensity(float density)
    Parameters
    Type Name Description
    float density

    Fraction of the blank cells holding a point, from 0 to 1.

    Returns
    Type Description
    TwinkleEffect

    This effect, for chaining.

    SetGlyphSet(string)

    Sets the characters the points are drawn from.

    Declaration
    public TwinkleEffect SetGlyphSet(string glyphSet)
    Parameters
    Type Name Description
    string glyphSet

    Characters to draw the points with.

    Returns
    Type Description
    TwinkleEffect

    This effect, for chaining.

    SetLifetime(float, float)

    Sets how long the points live before they move elsewhere.

    Declaration
    public TwinkleEffect SetLifetime(float minimum, float maximum)
    Parameters
    Type Name Description
    float minimum

    Shortest lifetime in seconds.

    float maximum

    Longest lifetime in seconds.

    Returns
    Type Description
    TwinkleEffect

    This effect, for chaining.

    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