Gondwana Game Engine
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop, mobile, and web platforms using SkiaSharp for graphics and NAudio for sound.
Loading...
Searching...
No Matches
Gondwana.Drawing.Direct.TextBlock Class Reference

A retained-mode text drawable with wrapping, multi-line (
) support, horizontal/vertical alignment, padding, optional shadow/outline effects, and auto-shrink to fit. More...

Inheritance diagram for Gondwana.Drawing.Direct.TextBlock:
Gondwana.Drawing.Direct.DirectDrawingMovableBase Gondwana.Drawing.Direct.DirectDrawingBase Gondwana.Movement.IMovable Gondwana.Drawing.Direct.IDirectDrawable Gondwana.Drawing.IDrawable

Public Types

enum  VerticalAlign { Top , Center , Bottom }
 Vertical alignment options for multi-line text within the control's bounds. More...
enum  PulseWave { Sine , Triangle }
 Selects the waveform used by PulseColor(Color, Color, float, bool, bool). More...
enum  TextRevealMode { None , CharactersPerSecond , WordsPerSecond , ManualCount }
 Describes the mode used for revealing text over time. More...
Public Types inherited from Gondwana.Drawing.Direct.DirectDrawingBase
enum  RevealDirection { LeftToRight , RightToLeft , TopToBottom , BottomToTop }
 Defines the direction from which a reveal animation progressively displays the direct drawing. More...

Public Member Functions

 TextBlock (RenderSurfaceHostBase renderSurfaceHost, SceneLayer sceneLayer, View? view, Rectangle worldBounds, string? nickname=null)
 TextBlock (RenderSurfaceHostBase renderSurfaceHost, View view, Rectangle screenBounds, string? nickname=null)
TextBlock SetText (string text)
 Sets the current text content and rebuilds layout as needed. If no reveal animation is active, the text is shown fully. If a reveal animation is active, the target length is synced to the new text.
TextBlock SetFont (SKTypeface typeface, float size, float? minSize=null)
 Sets the font face and size (and optional minimum size for auto-shrink).
TextBlock SetColors (SKColor fg, SKColor bg)
 Sets the foreground (text) and background colors using Skia colors.
TextBlock SetColors (Color fg, Color bg)
 Sets the foreground (text) and background colors using System.Drawing colors.
TextBlock SetAlignment (SKTextAlign h, VerticalAlign v)
 Sets the horizontal and vertical alignment used when drawing the laid-out lines within the bounds.
TextBlock UseShadow (bool enable=true)
 Enables or disables drawing a drop shadow behind the text (parameters are configured via SetShadow(float, float, byte, float)).
TextBlock SetShadow (float dx, float dy, byte alpha=128, float blurSigma=1.5f)
 Configures the drop shadow effect for text rendering.
TextBlock UseOutline (bool enable=true)
 Enables or disables a 1-pixel outline stroke around the text glyphs.
TextBlock EnableWrapping (bool enable=true)
 Enables or disables word wrapping when laying out paragraphs.
TextBlock SetMaxLines (int? maxLines)
 Sets a maximum number of lines to draw. If null, all laid-out lines are drawn.
TextBlock PulseColor (Color from, Color to, float periodSec, bool enabled=true, bool triangle=false)
 Animates the text color between from and to over periodSec seconds.
TextBlock StopColorPulse ()
 Stops text color pulsing and restores the base foreground color.
TextBlock StartTypewriter (float charsPerSecond, int? maxChars=null, bool enablePauses=true, float longPauseSec=0.25f, float shortPauseSec=0.10f)
 Begins a character-by-character reveal (typewriter effect).
TextBlock StartWordReveal (float wordsPerSecond, bool enablePauses=true, float longPauseSec=0.25f, float shortPauseSec=0.10f)
 Begins a word-by-word reveal. Words are detected by \S+\s* and include their trailing whitespace/punctuation.
TextBlock SetPunctuationPauses (bool enabled, float longPauseSec=0.25f, float shortPauseSec=0.10f)
 Configures punctuation pause behavior used by the current or next reveal animation.
TextBlock RevealSetCount (int charCount)
 Sets the currently revealed character count directly (manual mode).
TextBlock RevealStop ()
 Stops any active reveal animation and shows the full text immediately.
override void Update (long tick)
 Advances internal animations (pulse, typewriter/word reveal) based on the current tick, and then allows the base class to progress fade and bookkeeping. Called once per frame.
Public Member Functions inherited from Gondwana.Drawing.Direct.DirectDrawingMovableBase
Vector2 GetPosition ()
 Gets the current position of this direct drawing in pixel coordinates.
void SetPosition (Vector2 p)
 Sets the position of this direct drawing to the specified pixel coordinates.
Public Member Functions inherited from Gondwana.Drawing.Direct.DirectDrawingBase
RectangleF GetDrawLocationScreen (View view)
 Gets the screen-space drawing location for this direct drawing as seen from the specified view.
void Draw (BackbufferBase backbuffer, RectangleF destRectScreen)
 Renders this direct drawing to the backbuffer at the specified screen location.
DirectDrawingBase SetOpacity (float opacity)
 Instantly sets the opacity to the specified value without animation.
DirectDrawingBase FadeTo (float targetOpacity, float durationSec)
 Initiates a smooth fade transition to the specified target opacity over the given duration.
DirectDrawingBase FadeIn (float durationSec)
 Fades this direct drawing from its current opacity to fully opaque over the specified duration.
DirectDrawingBase FadeOut (float durationSec)
 Fades this direct drawing from its current opacity to fully transparent over the specified duration.
DirectDrawingBase CancelFade ()
 Cancels any active fade transition, leaving the opacity at its current value.
DirectDrawingBase SetReveal (float t01)
 Instantly sets the reveal progress to the specified value without animation.
DirectDrawingBase SetRevealDirection (RevealDirection dir)
 Sets the direction from which the reveal animation progresses.
DirectDrawingBase RevealTo (float t01, float durationSec, Func< float, float >? easing=null)
 Initiates a smooth reveal animation to the specified target progress over the given duration, optionally using a custom easing function.
int CompareTo (DirectDrawingBase? other)
 Compares this direct drawing to another for sorting by ZOrder.
void Dispose ()
 Releases all resources used by this DirectDrawingBase instance.
override bool Equals (object? obj)
 Determines whether the specified object is equal to the current direct drawing.
override int GetHashCode ()
 Returns a hash code for this direct drawing.

Protected Member Functions

override void OnDraw (BackbufferBase backbuffer, RectangleF destRectScreen)
override void Dispose (bool disposing)
 Releases resources used by this DirectDrawingBase instance.
Protected Member Functions inherited from Gondwana.Drawing.Direct.DirectDrawingMovableBase
 DirectDrawingMovableBase (RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, SceneLayer? sceneLayer, View? view, Rectangle? screenBounds, Rectangle? worldBounds, string? name=null)
 Initializes a new instance of the DirectDrawingMovableBase class with integrated movement capabilities.
Protected Member Functions inherited from Gondwana.Drawing.Direct.DirectDrawingBase
void OnDraw (BackbufferBase backbuffer, RectangleF destRectScreen)
 Performs the concrete drawing for this direct drawing to the backbuffer.
 DirectDrawingBase (RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, SceneLayer? sceneLayer, View? view, Rectangle? screenBounds, Rectangle? worldBounds, string? nickname=null)
 Initializes a new instance of the DirectDrawingBase class.

Properties

float LineSpacingMultiplier = 1.0f [get, set]
 Gets or sets a scale factor applied to the computed line height (1.0 = natural spacing).
float HorizontalPadding = 0f [get, set]
 Gets or sets the horizontal padding (in pixels) on both left and right sides of the text.
float VerticalPadding = 0f [get, set]
 Gets or sets the vertical padding (in pixels) on both top and bottom sides of the text.
string Text [get]
 Gets the current raw text content.
List< string > Lines [get]
 Gets the laid-out lines (after wrapping and paragraph processing).
float LineHeight [get]
 Gets the measured line height (in pixels) used for drawing.
SKColor ForeColor [get]
 Gets the configured foreground (text) color.
SKColor BackColor [get]
 Gets the configured background color.
float FontSize [get]
 Gets the requested font size (before any auto-shrink adjustments).
float? MinFontSize [get]
 Gets the optional minimum font size used by auto-shrink (or null if disabled).
SKTypeface? TypeFace [get]
 Gets the configured typeface (or null to use SKTypeface.Default).
bool OutlineEnabled [get]
 Gets a value indicating whether an outline stroke is enabled.
bool WrapText [get]
 Gets a value indicating whether word wrapping is enabled.
int? MaxLines [get]
 Gets the optional maximum number of lines to draw (or null for no limit).
bool ShadowEnabled [get]
 Gets a value indicating whether a drop shadow is enabled.
float ShadowDx [get]
 Gets the horizontal shadow offset (in pixels).
float ShadowDy [get]
 Gets the vertical shadow offset (in pixels).
byte ShadowAlpha [get]
 Gets the shadow opacity (0–255).
float ShadowBlurSigma [get]
 Gets the blur radius for the shadow (sigma, in pixels).
SKTextAlign AlignHoriz [get]
 Gets the horizontal alignment used when drawing lines.
VerticalAlign AlignVert [get]
 Gets the vertical alignment used when drawing lines.
bool PulseTextEnabled [get]
 Gets a value indicating whether color pulsing is enabled.
SKColor PulseFrom [get]
 Gets the starting color for the pulse effect.
SKColor PulseTo [get]
 Gets the ending color for the pulse effect.
float PulsePeriodSec [get]
 Gets the pulse period in seconds.
PulseWave PulseWaveValue [get]
 Gets the pulse waveform currently in use.
TextRevealMode TextRevealModeValue [get]
 Gets the active text reveal mode.
float TextRevealRate [get]
 Gets the configured reveal rate (characters/sec or words/sec depending on mode).
bool PuctuationPauseEnabled [get]
 Gets a value indicating whether punctuation pauses are enabled.
float PunctiationPauseLongSec [get]
 Gets the long punctuation pause duration (seconds) used for '.', '!', '?'.
float PunctiationPauseShortSec [get]
 Gets the short punctuation pause duration (seconds) used for ',', ';', ':'.
SKColor ResovedForeColor [get]
 Gets the currently resolved (effective) foreground color used for drawing.
Properties inherited from Gondwana.Drawing.Direct.DirectDrawingMovableBase
MovementController Movement [get]
 Gets the movement controller that manages physics-based position, velocity, and forces for this direct drawing.
MovementSpace PositionSpace [get]
 Gets the coordinate space in which this movable object's position is expressed.
Properties inherited from Gondwana.Drawing.Direct.DirectDrawingBase
bool HideWhenFullyTransparent = true [get, set]
 Gets or sets a value indicating whether this direct drawing should be automatically hidden when its opacity reaches zero during fade transitions.
RenderSurfaceHostBase RenderSurfaceHost [get]
 Gets the render surface host that manages this direct drawing's rendering pipeline.
DirectDrawingMode Mode [get]
 Gets the drawing mode that determines how this direct drawing is positioned and transformed.
SceneLayerSceneLayer [get]
 Gets the scene layer to which this direct drawing is attached, or null if the drawing is in view mode.
ViewView [get]
 Gets the view to which this direct drawing is attached, or null if the drawing is in scene-layer mode.
Rectangle ScreenBounds [get, set]
 Gets or sets the screen-space bounds of this direct drawing in pixels.
Rectangle WorldBounds [get, set]
 Gets or sets the world-space bounds of this direct drawing in pixels.
TypedValueBag ValueBag = new() [get]
 Gets the extensible value bag for storing arbitrary key-value data associated with this direct drawing.
Guid Id = Guid.NewGuid() [get]
 Gets the unique identifier for this direct drawing.
string? Nickname [get]
 Gets the optional human-readable name for this direct drawing.
int ZOrder [get, set]
 Gets or sets the Z-order (depth) used for sorting this direct drawing relative to other drawables.
bool Visible [get, set]
 Gets or sets a value indicating whether this direct drawing is visible and should be rendered.
float Opacity [get, set]
 Gets or sets the current opacity of this direct drawing.

Events

Action< string >? TextRevealed
 Raised whenever the revealed text portion advances. The argument is the cumulative text currently revealed (substring from start to visible character count).
Action< string >? TextRevealComplete
 Raised once when the reveal completes. Argument is the full text content. Note: when the final chunk is revealed this class will raise TextRevealed first, then TextRevealComplete.
Events inherited from Gondwana.Drawing.Direct.DirectDrawingBase
EventHandler< IDirectDrawable >? Disposing
 Occurs when this direct drawing is being disposed.
EventHandler< DirectDrawingBase >? FadeToCompleted
 Occurs when a fade transition initiated by FadeTo, FadeIn, or FadeOut completes.
Events inherited from Gondwana.Drawing.Direct.IDirectDrawable
EventHandler< IDirectDrawable >? Disposing
 Occurs when the object is being disposed.

Additional Inherited Members

Static Public Member Functions inherited from Gondwana.Drawing.Direct.DirectDrawingBase
static bool operator== (DirectDrawingBase? left, DirectDrawingBase? right)
 Determines whether two direct drawing instances are equal using reference equality.
static bool operator!= (DirectDrawingBase? left, DirectDrawingBase? right)
 Determines whether two direct drawing instances are not equal using reference equality.
static bool operator< (DirectDrawingBase? left, DirectDrawingBase? right)
 Determines whether the Z-order of the left direct drawing is less than the right.
static bool operator<= (DirectDrawingBase? left, DirectDrawingBase? right)
 Determines whether the Z-order of the left direct drawing is less than or equal to the right.
static bool operator> (DirectDrawingBase? left, DirectDrawingBase? right)
 Determines whether the Z-order of the left direct drawing is greater than the right.
static bool operator>= (DirectDrawingBase? left, DirectDrawingBase? right)
 Determines whether the Z-order of the left direct drawing is greater than or equal to the right.
Protected Attributes inherited from Gondwana.Drawing.Direct.DirectDrawingBase
readonly RenderSurfaceHostBase _renderSurfaceHost
 The render surface host that manages this direct drawing's rendering pipeline.
Rectangle _screenBounds
 The current screen-space bounds for view-mode direct drawings, in pixels.
Rectangle _worldBounds
 The current world-space bounds for scene-layer-mode direct drawings, in pixels.
int _zOrder
 The Z-order used for draw sorting. Higher values draw later (on top).
bool _visible
 Indicates whether this direct drawing is currently visible and should be rendered.
long _lastTick = HighResTimer.GetCurrentTick()
 The last engine tick value used for delta-time calculations in Update.

Detailed Description

A retained-mode text drawable with wrapping, multi-line (
) support, horizontal/vertical alignment, padding, optional shadow/outline effects, and auto-shrink to fit.

TextBlock caches a line layout derived from the current text, font, bounds, and wrapping settings, and only rebuilds when any of those change. Newlines (
) are respected as hard breaks; long lines wrap to the available width when wrapping is enabled.

Horizontal alignment (left/center/right) and vertical alignment (top/center/bottom) are applied per frame. Optional background fill, shadow, and outline can be enabled for readability. When a minimum font size is specified, the control will step down from the requested size until the text fits within the height or the minimum is reached.

// Centered, wrapped headline with shadow and outline var headline = new TextBlock(surface, new Rectangle(0, 0, 640, 140)) .SetText("Gondwana welcomes you\n— render boldly.") .SetFont(SKTypeface.Default, 28f, minSize: 16f) .SetColors(SKColors.White, SKColors.Transparent) .SetAlignment(SKTextAlign.Center, TextBlock.VerticalAlign.Center) .EnableWrapping(true) .SetMaxLines(3) .UseShadow(true) .UseOutline(true);

Member Enumeration Documentation

◆ PulseWave

Selects the waveform used by PulseColor(Color, Color, float, bool, bool).

Enumerator
Sine 

Sine wave: smooth continuous pulse between colors.

Triangle 

Triangle wave: linear fade-in/out between colors.

◆ TextRevealMode

Describes the mode used for revealing text over time.

Enumerator
None 

No reveal is active; all text is shown.

CharactersPerSecond 

Reveal advances by characters per second.

WordsPerSecond 

Reveal advances by words per second.

ManualCount 

Reveal amount is controlled directly via RevealSetCount(int).

◆ VerticalAlign

Vertical alignment options for multi-line text within the control's bounds.

Enumerator
Top 

Align text to the top of the inner content area.

Center 

Center text vertically within the inner content area.

Bottom 

Align text to the bottom of the inner content area.

Constructor & Destructor Documentation

◆ TextBlock() [1/2]

Gondwana.Drawing.Direct.TextBlock.TextBlock ( RenderSurfaceHostBase renderSurfaceHost,
SceneLayer sceneLayer,
View? view,
Rectangle worldBounds,
string? nickname = null )

◆ TextBlock() [2/2]

Gondwana.Drawing.Direct.TextBlock.TextBlock ( RenderSurfaceHostBase renderSurfaceHost,
View view,
Rectangle screenBounds,
string? nickname = null )

Member Function Documentation

◆ Dispose()

override void Gondwana.Drawing.Direct.TextBlock.Dispose ( bool disposing)
protectedvirtual

Releases resources used by this DirectDrawingBase instance.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources (called from finalizer).

When disposing is true, this method:

  • Marks affected regions as dirty by calling ForceRefresh.
  • Raises the Disposing event.
  • Clears all event handlers to prevent memory leaks.

Override this method in derived classes to release additional resources. Always call base.Dispose(disposing) to ensure proper cleanup of the base class.

Reimplemented from Gondwana.Drawing.Direct.DirectDrawingBase.

◆ EnableWrapping()

TextBlock Gondwana.Drawing.Direct.TextBlock.EnableWrapping ( bool enable = true)

Enables or disables word wrapping when laying out paragraphs.

Parameters
enableTrue to wrap text to the available width; false to keep each paragraph on one line.
Returns
The current TextBlock for chaining.

◆ OnDraw()

override void Gondwana.Drawing.Direct.TextBlock.OnDraw ( BackbufferBase backbuffer,
RectangleF destRectScreen )
protected

◆ PulseColor()

TextBlock Gondwana.Drawing.Direct.TextBlock.PulseColor ( Color from,
Color to,
float periodSec,
bool enabled = true,
bool triangle = false )

Animates the text color between from and to over periodSec seconds.

Parameters
fromStarting text color.
toEnding text color.
periodSecTime in seconds for one full pulse cycle.
enabledTrue to enable pulsing; false to disable.
triangleTrue to use a triangle waveform; otherwise a sine wave is used.
Returns
The current TextBlock for chaining.

◆ RevealSetCount()

TextBlock Gondwana.Drawing.Direct.TextBlock.RevealSetCount ( int charCount)

Sets the currently revealed character count directly (manual mode).

Parameters
charCountThe number of characters (from the start of the text) to show.
Returns
The current TextBlock for chaining.

◆ RevealStop()

TextBlock Gondwana.Drawing.Direct.TextBlock.RevealStop ( )

Stops any active reveal animation and shows the full text immediately.

Returns
The current TextBlock for chaining.

◆ SetAlignment()

TextBlock Gondwana.Drawing.Direct.TextBlock.SetAlignment ( SKTextAlign h,
VerticalAlign v )

Sets the horizontal and vertical alignment used when drawing the laid-out lines within the bounds.

Parameters
hHorizontal alignment (Left, Center, Right).
vVertical alignment (Top, Center, Bottom).
Returns
The current TextBlock for chaining.

◆ SetColors() [1/2]

TextBlock Gondwana.Drawing.Direct.TextBlock.SetColors ( Color fg,
Color bg )

Sets the foreground (text) and background colors using System.Drawing colors.

Parameters
fgText color.
bgBackground color (drawn as a solid rect if alpha > 0).
Returns
The current TextBlock for chaining.

◆ SetColors() [2/2]

TextBlock Gondwana.Drawing.Direct.TextBlock.SetColors ( SKColor fg,
SKColor bg )

Sets the foreground (text) and background colors using Skia colors.

Parameters
fgText color.
bgBackground color (drawn as a solid rect if alpha > 0).
Returns
The current TextBlock for chaining.

◆ SetFont()

TextBlock Gondwana.Drawing.Direct.TextBlock.SetFont ( SKTypeface typeface,
float size,
float? minSize = null )

Sets the font face and size (and optional minimum size for auto-shrink).

Parameters
typefaceTypeface to use; defaults to SKTypeface.Default if null.
sizeRequested font size in pixels.
minSizeOptional minimum size for auto-shrink; if set, layout will step down to fit height.
Returns
The current TextBlock for chaining.

◆ SetMaxLines()

TextBlock Gondwana.Drawing.Direct.TextBlock.SetMaxLines ( int? maxLines)

Sets a maximum number of lines to draw. If null, all laid-out lines are drawn.

Parameters
maxLinesMaximum visible lines, or null for no limit.
Returns
The current TextBlock for chaining.

◆ SetPunctuationPauses()

TextBlock Gondwana.Drawing.Direct.TextBlock.SetPunctuationPauses ( bool enabled,
float longPauseSec = 0::25f,
float shortPauseSec = 0::10f )

Configures punctuation pause behavior used by the current or next reveal animation.

Parameters
enabledTrue to enable punctuation pauses; false to disable.
longPauseSecPause after '.', '!', or '?' (seconds).
shortPauseSecPause after ',', ';', or ':' (seconds).
Returns
The current TextBlock for chaining.

◆ SetShadow()

TextBlock Gondwana.Drawing.Direct.TextBlock.SetShadow ( float dx,
float dy,
byte alpha = 128,
float blurSigma = 1::5f )

Configures the drop shadow effect for text rendering.

Parameters
dxHorizontal offset in pixels for the shadow. Positive values move the shadow right, negative left.
dyVertical offset in pixels for the shadow. Positive values move the shadow down, negative up.
alphaOpacity of the shadow (0–255). Higher values make the shadow darker and more opaque.
blurSigmaBlur radius in pixels for the shadow’s softness. Set to 0 for a hard shadow. Typical range: 1.0–3.0.

Call this after UseShadow(bool) to fine-tune the offset, opacity, and blur strength of the text shadow. This method sets the internal paint values and marks the text block as dirty so it will be redrawn on the next render pass.

Returns
The current TextBlock instance for method chaining.

◆ SetText()

TextBlock Gondwana.Drawing.Direct.TextBlock.SetText ( string text)

Sets the current text content and rebuilds layout as needed. If no reveal animation is active, the text is shown fully. If a reveal animation is active, the target length is synced to the new text.

Parameters
textThe new text to display (null is treated as an empty string).
Returns
The current TextBlock for chaining.

◆ StartTypewriter()

TextBlock Gondwana.Drawing.Direct.TextBlock.StartTypewriter ( float charsPerSecond,
int? maxChars = null,
bool enablePauses = true,
float longPauseSec = 0::25f,
float shortPauseSec = 0::10f )

Begins a character-by-character reveal (typewriter effect).

Parameters
charsPerSecondCharacters per second to reveal.
maxCharsOptional cap on total characters to reveal; defaults to the full text length.
enablePausesTrue to add punctuation pauses during reveal; false for uniform pacing.
longPauseSecPause added after '.', '!', or '?' characters (seconds).
shortPauseSecPause added after ',', ';', or ':' characters (seconds).
Returns
The current TextBlock for chaining.

◆ StartWordReveal()

TextBlock Gondwana.Drawing.Direct.TextBlock.StartWordReveal ( float wordsPerSecond,
bool enablePauses = true,
float longPauseSec = 0::25f,
float shortPauseSec = 0::10f )

Begins a word-by-word reveal. Words are detected by \S+\s* and include their trailing whitespace/punctuation.

Parameters
wordsPerSecondWords per second to reveal.
enablePausesTrue to add punctuation pauses during reveal; false for uniform pacing.
longPauseSecPause added after '.', '!', or '?' characters (seconds).
shortPauseSecPause added after ',', ';', or ':' characters (seconds).
Returns
The current TextBlock for chaining.

◆ StopColorPulse()

TextBlock Gondwana.Drawing.Direct.TextBlock.StopColorPulse ( )

Stops text color pulsing and restores the base foreground color.

Returns
The current TextBlock for chaining.

◆ Update()

override void Gondwana.Drawing.Direct.TextBlock.Update ( long tick)
virtual

Advances internal animations (pulse, typewriter/word reveal) based on the current tick, and then allows the base class to progress fade and bookkeeping. Called once per frame.

Parameters
tickHigh-resolution tick value for this frame.

Reimplemented from Gondwana.Drawing.Direct.DirectDrawingMovableBase.

◆ UseOutline()

TextBlock Gondwana.Drawing.Direct.TextBlock.UseOutline ( bool enable = true)

Enables or disables a 1-pixel outline stroke around the text glyphs.

Parameters
enableTrue to enable an outline; false to disable.
Returns
The current TextBlock for chaining.

◆ UseShadow()

TextBlock Gondwana.Drawing.Direct.TextBlock.UseShadow ( bool enable = true)

Enables or disables drawing a drop shadow behind the text (parameters are configured via SetShadow(float, float, byte, float)).

Parameters
enableTrue to enable the shadow; false to disable.
Returns
The current TextBlock for chaining.

Property Documentation

◆ AlignHoriz

SKTextAlign Gondwana.Drawing.Direct.TextBlock.AlignHoriz
get

Gets the horizontal alignment used when drawing lines.

◆ AlignVert

VerticalAlign Gondwana.Drawing.Direct.TextBlock.AlignVert
get

Gets the vertical alignment used when drawing lines.

◆ BackColor

SKColor Gondwana.Drawing.Direct.TextBlock.BackColor
get

Gets the configured background color.

◆ FontSize

float Gondwana.Drawing.Direct.TextBlock.FontSize
get

Gets the requested font size (before any auto-shrink adjustments).

◆ ForeColor

SKColor Gondwana.Drawing.Direct.TextBlock.ForeColor
get

Gets the configured foreground (text) color.

◆ HorizontalPadding

float Gondwana.Drawing.Direct.TextBlock.HorizontalPadding = 0f
getset

Gets or sets the horizontal padding (in pixels) on both left and right sides of the text.

◆ LineHeight

float Gondwana.Drawing.Direct.TextBlock.LineHeight
get

Gets the measured line height (in pixels) used for drawing.

◆ Lines

List<string> Gondwana.Drawing.Direct.TextBlock.Lines
get

Gets the laid-out lines (after wrapping and paragraph processing).

◆ LineSpacingMultiplier

float Gondwana.Drawing.Direct.TextBlock.LineSpacingMultiplier = 1.0f
getset

Gets or sets a scale factor applied to the computed line height (1.0 = natural spacing).

◆ MaxLines

int? Gondwana.Drawing.Direct.TextBlock.MaxLines
get

Gets the optional maximum number of lines to draw (or null for no limit).

◆ MinFontSize

float? Gondwana.Drawing.Direct.TextBlock.MinFontSize
get

Gets the optional minimum font size used by auto-shrink (or null if disabled).

◆ OutlineEnabled

bool Gondwana.Drawing.Direct.TextBlock.OutlineEnabled
get

Gets a value indicating whether an outline stroke is enabled.

◆ PuctuationPauseEnabled

bool Gondwana.Drawing.Direct.TextBlock.PuctuationPauseEnabled
get

Gets a value indicating whether punctuation pauses are enabled.

◆ PulseFrom

SKColor Gondwana.Drawing.Direct.TextBlock.PulseFrom
get

Gets the starting color for the pulse effect.

◆ PulsePeriodSec

float Gondwana.Drawing.Direct.TextBlock.PulsePeriodSec
get

Gets the pulse period in seconds.

◆ PulseTextEnabled

bool Gondwana.Drawing.Direct.TextBlock.PulseTextEnabled
get

Gets a value indicating whether color pulsing is enabled.

◆ PulseTo

SKColor Gondwana.Drawing.Direct.TextBlock.PulseTo
get

Gets the ending color for the pulse effect.

◆ PulseWaveValue

PulseWave Gondwana.Drawing.Direct.TextBlock.PulseWaveValue
get

Gets the pulse waveform currently in use.

◆ PunctiationPauseLongSec

float Gondwana.Drawing.Direct.TextBlock.PunctiationPauseLongSec
get

Gets the long punctuation pause duration (seconds) used for '.', '!', '?'.

◆ PunctiationPauseShortSec

float Gondwana.Drawing.Direct.TextBlock.PunctiationPauseShortSec
get

Gets the short punctuation pause duration (seconds) used for ',', ';', ':'.

◆ ResovedForeColor

SKColor Gondwana.Drawing.Direct.TextBlock.ResovedForeColor
get

Gets the currently resolved (effective) foreground color used for drawing.

◆ ShadowAlpha

byte Gondwana.Drawing.Direct.TextBlock.ShadowAlpha
get

Gets the shadow opacity (0–255).

◆ ShadowBlurSigma

float Gondwana.Drawing.Direct.TextBlock.ShadowBlurSigma
get

Gets the blur radius for the shadow (sigma, in pixels).

◆ ShadowDx

float Gondwana.Drawing.Direct.TextBlock.ShadowDx
get

Gets the horizontal shadow offset (in pixels).

◆ ShadowDy

float Gondwana.Drawing.Direct.TextBlock.ShadowDy
get

Gets the vertical shadow offset (in pixels).

◆ ShadowEnabled

bool Gondwana.Drawing.Direct.TextBlock.ShadowEnabled
get

Gets a value indicating whether a drop shadow is enabled.

◆ Text

string Gondwana.Drawing.Direct.TextBlock.Text
get

Gets the current raw text content.

◆ TextRevealModeValue

TextRevealMode Gondwana.Drawing.Direct.TextBlock.TextRevealModeValue
get

Gets the active text reveal mode.

◆ TextRevealRate

float Gondwana.Drawing.Direct.TextBlock.TextRevealRate
get

Gets the configured reveal rate (characters/sec or words/sec depending on mode).

◆ TypeFace

SKTypeface? Gondwana.Drawing.Direct.TextBlock.TypeFace
get

Gets the configured typeface (or null to use SKTypeface.Default).

◆ VerticalPadding

float Gondwana.Drawing.Direct.TextBlock.VerticalPadding = 0f
getset

Gets or sets the vertical padding (in pixels) on both top and bottom sides of the text.

◆ WrapText

bool Gondwana.Drawing.Direct.TextBlock.WrapText
get

Gets a value indicating whether word wrapping is enabled.

Event Documentation

◆ TextRevealComplete

Action<string>? Gondwana.Drawing.Direct.TextBlock.TextRevealComplete

Raised once when the reveal completes. Argument is the full text content. Note: when the final chunk is revealed this class will raise TextRevealed first, then TextRevealComplete.

◆ TextRevealed

Action<string>? Gondwana.Drawing.Direct.TextBlock.TextRevealed

Raised whenever the revealed text portion advances. The argument is the cumulative text currently revealed (substring from start to visible character count).