Skip to content

LedTextBasedDataSource

ClassLEDStudioLEDStudio
[ExecuteAlways]
public abstract class LedTextBasedDataSource : LedDataSourceBase, ILedSource, ITextBlinkSource

Common base for text-based data source components that share appearance, font and scrolling settings. Derive from this instead of LEDStudio.LedDataSourceBase for any source backed by a LEDStudio.ITextStyledSource.

[Header("Appearance")]
[Tooltip("Text color used by this source before board brightness and material response are applied.")]
[SerializeField]
protected Color _textColor

Returns

UnityEngine.Color

[Tooltip("Optional backing color drawn behind the measured text cells. Transparent leaves playlist content visible through glyph holes and spaces.")]
[SerializeField]
protected Color _backgroundColor

Returns

UnityEngine.Color

[Header("Font")]
[Tooltip("TMP font used when Text Rendering / Render Mode is Font Texture")]
[SerializeField]
protected TMP_FontAsset _fontAsset

Returns

TMPro.TMP_FontAsset

[Tooltip("Text sizing, alignment, wrapping and rasterization settings.")]
[SerializeField]
protected LedTextSettings _textSettings

Returns

LEDStudio.LedTextSettings

[Tooltip("Optional reusable renderer profile used by external text render modes such as UniText.")]
[SerializeField]
protected LedTextRenderBackendAsset _textRenderBackendAsset

Returns

LEDStudio.LedTextRenderBackendAsset

[Header("Scrolling")]
[Tooltip("Automatically scroll text")]
[SerializeField]
protected bool _autoScroll

Returns

System.Boolean

[Tooltip("Scroll even when text fits within the board width")]
[SerializeField]
protected bool _alwaysScroll

Returns

System.Boolean

[Tooltip("When scrolling text leaves one edge, repeat it at the opposite edge instead of leaving an empty gap.")]
[SerializeField]
protected bool _seamlessWrap

Returns

System.Boolean

[Tooltip("Minimum transparent gap in source pixels between seamless text repetitions.")]
[SerializeField]
[Range(0, 512)]
protected float _seamlessWrapPaddingPixels

Returns

System.Single

[Tooltip("Controls whether seamless text appears once or is evenly repeated across the output width.")]
[SerializeField]
protected LedSeamlessWrapDistribution _seamlessWrapDistribution

Returns

LEDStudio.LedSeamlessWrapDistribution

[Tooltip("Axis used by automatic scrolling, manual scroll offset, and seamless wrap.")]
[SerializeField]
protected LedTextScrollAxis _scrollAxis

Returns

LEDStudio.LedTextScrollAxis

[Tooltip("Scroll speed in pixels per second (negative values scroll in the opposite direction)")]
[SerializeField]
[Range(-200, 200)]
protected float _scrollSpeed

Returns

System.Single

[Tooltip("Apply a custom starting position along the scrolling path. Disabled by default to avoid shifting existing text.")]
[SerializeField]
protected bool _enableScrollOffset

Returns

System.Boolean

[Tooltip("Initial position along the scrolling path. 0 starts at the beginning, 100 starts at the far end.")]
[SerializeField]
[Range(0, 100)]
protected float _scrollOffsetPercent

Returns

System.Single

[Header("Blinking")]
[Tooltip("Timed text blinking settings.")]
[SerializeField]
protected LedTextBlinkSettings _blinkSettings

Returns

LEDStudio.LedTextBlinkSettings

protected abstract void CreateSource(Vector2Int targetResolution)

Create the concrete source. Called from LEDStudio.LedTextBasedDataSource.Prepare(UnityEngine.Vector2Int).

Parameters

Name Type
targetResolution UnityEngine.Vector2Int
protected abstract void UpdateSubclassProperties()

Push subclass-specific inspector changes during LEDStudio.LedTextBasedDataSource.UpdateSource(ImpossibleRobert.Common.Timing.TimeStep%40).

protected abstract void PushSubclassProperties()

Push all subclass-specific fields to the source (called from LEDStudio.LedTextBasedDataSource.OnValidate).

protected abstract void ReleaseSource()

Null out the concrete source reference (called from LEDStudio.LedTextBasedDataSource.Release).

protected LedTextSettings BuildTextSettings()

Builds normalized layout settings for the current text source.

Returns

LEDStudio.LedTextSettings

ConfigureTextStyle(Color?, LedTextSettings?, TMP_FontAsset, Color?, bool, bool, bool, float, LedSeamlessWrapDistribution, LedTextScrollAxis, float, bool, float, LedTextBlinkSettings?)

Section titled “ConfigureTextStyle(Color?, LedTextSettings?, TMP_FontAsset, Color?, bool, bool, bool, float, LedSeamlessWrapDistribution, LedTextScrollAxis, float, bool, float, LedTextBlinkSettings?)”
public void ConfigureTextStyle(Color? textColor = null, LedTextSettings? textSettings = null, TMP_FontAsset fontAsset = null, Color? backgroundColor = null, bool autoScroll = false, bool alwaysScroll = false, bool seamlessWrap = false, float seamlessWrapPaddingPixels = 8, LedSeamlessWrapDistribution seamlessWrapDistribution = LedSeamlessWrapDistribution.SingleRepeat, LedTextScrollAxis scrollAxis = LedTextScrollAxis.Horizontal, float scrollSpeed = 30, bool enableScrollOffset = false, float scrollOffsetPercent = 0, LedTextBlinkSettings? blinkSettings = null)

Replaces the source’s text appearance, scrolling, offset, and blinking configuration, then refreshes the owning board.

Parameters

Name Type Description
textColor System.Nullable{UnityEngine.Color} Foreground color, or null for white.
textSettings System.Nullable{LEDStudio.LedTextSettings} Text layout and renderer settings, or null for LED Studio defaults.
fontAsset TMPro.TMP_FontAsset Optional TextMesh Pro font used by font-backed rendering modes.
backgroundColor System.Nullable{UnityEngine.Color} Background color, or null for transparent.
autoScroll System.Boolean Whether overflowing content starts scrolling automatically.
alwaysScroll System.Boolean Whether content scrolls even when it already fits.
seamlessWrap System.Boolean Whether repeated content crosses the wrap boundary without a blank reset.
seamlessWrapPaddingPixels System.Single Gap between repeated copies in source pixels.
seamlessWrapDistribution LEDStudio.LedSeamlessWrapDistribution How repeated copies are distributed across the scroll cycle.
scrollAxis LEDStudio.LedTextScrollAxis Direction along which text moves.
scrollSpeed System.Single Signed scroll speed in source pixels per second.
enableScrollOffset System.Boolean Whether the explicit cycle offset is applied.
scrollOffsetPercent System.Single Initial position within the scroll cycle, from zero to 100.
blinkSettings System.Nullable{LEDStudio.LedTextBlinkSettings} Blink timing, or null to disable blinking with default timing.
public override sealed void Prepare(Vector2Int targetResolution)

Allocates or resizes source resources for the requested logical board resolution.

Parameters

Name Type
targetResolution UnityEngine.Vector2Int
public override sealed void UpdateSource(in TimeStep step)

Updates time-dependent content using the board’s deterministic simulation step.

Parameters

Name Type
step ImpossibleRobert.Common.Timing.TimeStep
public override sealed void MarkClean()

Clears dirty state after the compositor consumes the current output.

public override sealed void Release()

Releases textures and other resources owned by the source; repeated calls must be safe.

protected void MarkOwningBoardDirty()

Invalidates this source and its containing board so style or content changes are rendered on the next update.

protected LedTextBasedDataSource()

protected abstract ITextStyledSource StyledSource { get; }

The underlying text-styled source created by the subclass.

Returns

LEDStudio.ITextStyledSource

public LedTextBlinkSettings BlinkSettings { get; set; }

Returns

LEDStudio.LedTextBlinkSettings

public virtual bool RequiresTimeUpdates { get; }

Returns

System.Boolean

public LedTextRenderBackendAsset TextRenderBackendAsset { get; set; }

Returns

LEDStudio.LedTextRenderBackendAsset

public float ScrollSpeed { get; set; }

Returns

System.Single

public override sealed bool IsReady { get; }

Returns

System.Boolean

public override sealed bool IsDirty { get; }

Returns

System.Boolean

public override sealed Texture OutputTexture { get; }

Returns

UnityEngine.Texture