![]() |
Gondwana Game Engine Development (master) - 2.6.1
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 and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
|
A retained-mode text drawable with wrapping, multi-line (
) support, horizontal/vertical alignment, padding, optional shadow/outline effects, and auto-shrink to fit.
More...
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) | |
| Creates a new TextBlock that draws in world space on the specified scene layer. | |
| TextBlock (RenderSurfaceHostBase renderSurfaceHost, View view, Rectangle screenBounds, string? nickname=null) | |
| Creates a new TextBlock that draws in screen space relative to a view. | |
| float | MeasureMaximumVerticalScrollOffsetPx () |
| Measures the maximum vertical scroll offset required to expose all currently laid-out text. | |
| TextBlock | SetPadding (float horizontal, float vertical) |
| Sets symmetric horizontal and vertical padding and invalidates cached layout. | |
| TextBlock | SetSize (Size size) |
| Sets the text-block size while preserving its current position and invalidates cached layout. | |
| 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. | |
| DirectDrawingBase | CancelReveal () |
| Stops an active reveal animation at its current progress. | |
| 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) |
| Draws the laid-out text block contents into the destination rectangle. | |
| override void | Dispose (bool disposing) |
| Releases managed resources used by the text block. | |
| 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. | |
| float | VerticalScrollOffsetPx [get, set] |
| Gets or sets the vertical text-content scroll offset in native pixels. | |
| float | VerticalScrollEndPaddingPx [get, set] |
| Gets or sets extra scrollable space after the final laid-out line. | |
| 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 | PunctuationPauseLongSec [get] |
| Gets the long punctuation pause duration (seconds) used for '.', '!', '?'. | |
| float | PunctuationPauseShortSec [get] |
| Gets the short punctuation pause duration (seconds) used for ',', ';', ':'. | |
| SKColor | ResolvedForeColor [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 responsible for changing this direct drawing's position over time. | |
| 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. | |
| SceneLayer? | SceneLayer [get] |
Gets the scene layer to which this direct drawing is attached, or null if the drawing is in view mode. | |
| View? | View [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. | |
| Properties inherited from Gondwana.Drawing.Direct.IDirectCompositeChild | |
| SceneLayer? | SceneLayer [get] |
Gets the scene layer used by a scene-layer child, or null for a view child. | |
| View? | View [get] |
Gets the view used by a view child, or null for a scene-layer child. | |
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. | |
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);
Definition at line 43 of file TextBlock.cs.
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. |
Definition at line 1244 of file TextBlock.cs.
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). |
Definition at line 1255 of file TextBlock.cs.
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. |
Definition at line 48 of file TextBlock.cs.
| Gondwana.Drawing.Direct.TextBlock.TextBlock | ( | RenderSurfaceHostBase | renderSurfaceHost, |
| SceneLayer | sceneLayer, | ||
| View? | view, | ||
| Rectangle | worldBounds, | ||
| string? | nickname = null ) |
Creates a new TextBlock that draws in world space on the specified scene layer.
| renderSurfaceHost | The render surface host that owns this direct drawing. |
| sceneLayer | The scene layer used for world-space positioning and refresh. |
| view | The optional view associated with the text block. |
| worldBounds | The text block bounds in world coordinates. |
| nickname | An optional nickname used to identify the text block. |
Definition at line 161 of file TextBlock.cs.
| Gondwana.Drawing.Direct.TextBlock.TextBlock | ( | RenderSurfaceHostBase | renderSurfaceHost, |
| View | view, | ||
| Rectangle | screenBounds, | ||
| string? | nickname = null ) |
Creates a new TextBlock that draws in screen space relative to a view.
| renderSurfaceHost | The render surface host that owns this direct drawing. |
| view | The view the text block is associated with. |
| screenBounds | The text block bounds in screen coordinates. |
| nickname | An optional nickname used to identify the text block. |
Definition at line 182 of file TextBlock.cs.
|
protectedvirtual |
Releases managed resources used by the text block.
| disposing | true when disposing managed resources; otherwise, false. |
Reimplemented from Gondwana.Drawing.Direct.DirectDrawingBase.
Definition at line 1273 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.EnableWrapping | ( | bool | enable = true | ) |
Enables or disables word wrapping when laying out paragraphs.
| enable | True to wrap text to the available width; false to keep each paragraph on one line. |
Definition at line 503 of file TextBlock.cs.
| float Gondwana.Drawing.Direct.TextBlock.MeasureMaximumVerticalScrollOffsetPx | ( | ) |
Measures the maximum vertical scroll offset required to expose all currently laid-out text.
Definition at line 263 of file TextBlock.cs.
|
protected |
Draws the laid-out text block contents into the destination rectangle.
| backbuffer | The backbuffer that provides the target drawing surface. |
| destRectScreen | The destination rectangle in screen space. |
Definition at line 826 of file TextBlock.cs.
| 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.
| from | Starting text color. |
| to | Ending text color. |
| periodSec | Time in seconds for one full pulse cycle. |
| enabled | True to enable pulsing; false to disable. |
| triangle | True to use a triangle waveform; otherwise a sine wave is used. |
Definition at line 532 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.RevealSetCount | ( | int | charCount | ) |
Sets the currently revealed character count directly (manual mode).
| charCount | The number of characters (from the start of the text) to show. |
Definition at line 647 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.RevealStop | ( | ) |
Stops any active reveal animation and shows the full text immediately.
Definition at line 660 of file TextBlock.cs.
| 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.
| h | Horizontal alignment (Left, Center, Right). |
| v | Vertical alignment (Top, Center, Bottom). |
Definition at line 433 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.SetColors | ( | Color | fg, |
| Color | bg ) |
Sets the foreground (text) and background colors using System.Drawing colors.
| fg | Text color. |
| bg | Background color (drawn as a solid rect if alpha > 0). |
| TextBlock Gondwana.Drawing.Direct.TextBlock.SetColors | ( | SKColor | fg, |
| SKColor | bg ) |
Sets the foreground (text) and background colors using Skia colors.
| fg | Text color. |
| bg | Background color (drawn as a solid rect if alpha > 0). |
Definition at line 410 of file TextBlock.cs.
| 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).
| typeface | Typeface to use; defaults to SKTypeface.Default if null. |
| size | Requested font size in pixels. |
| minSize | Optional minimum size for auto-shrink; if set, layout will step down to fit height. |
Definition at line 394 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.SetMaxLines | ( | int? | maxLines | ) |
Sets a maximum number of lines to draw. If null, all laid-out lines are drawn.
| maxLines | Maximum visible lines, or null for no limit. |
Definition at line 516 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.SetPadding | ( | float | horizontal, |
| float | vertical ) |
Sets symmetric horizontal and vertical padding and invalidates cached layout.
| horizontal | Horizontal padding in pixels for both left and right sides. |
| vertical | Vertical padding in pixels for both top and bottom sides. |
Definition at line 317 of file TextBlock.cs.
| 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.
| enabled | True to enable punctuation pauses; false to disable. |
| longPauseSec | Pause after '.', '!', or '?' (seconds). |
| shortPauseSec | Pause after ',', ';', or ':' (seconds). |
Definition at line 634 of file TextBlock.cs.
| 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.
| dx | Horizontal offset in pixels for the shadow. Positive values move the shadow right, negative left. |
| dy | Vertical offset in pixels for the shadow. Positive values move the shadow down, negative up. |
| alpha | Opacity of the shadow (0-255). Higher values make the shadow darker and more opaque. |
| blurSigma | Blur 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.
Definition at line 476 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.SetSize | ( | Size | size | ) |
Sets the text-block size while preserving its current position and invalidates cached layout.
| size | The new text-block size. |
Definition at line 336 of file TextBlock.cs.
| 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.
| text | The new text to display (null is treated as an empty string). |
Definition at line 358 of file TextBlock.cs.
| 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).
| charsPerSecond | Characters per second to reveal. |
| maxChars | Optional cap on total characters to reveal; defaults to the full text length. |
| enablePauses | True to add punctuation pauses during reveal; false for uniform pacing. |
| longPauseSec | Pause added after '.', '!', or '?' characters (seconds). |
| shortPauseSec | Pause added after ',', ';', or ':' characters (seconds). |
Definition at line 567 of file TextBlock.cs.
| 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.
| wordsPerSecond | Words per second to reveal. |
| enablePauses | True to add punctuation pauses during reveal; false for uniform pacing. |
| longPauseSec | Pause added after '.', '!', or '?' characters (seconds). |
| shortPauseSec | Pause added after ',', ';', or ':' characters (seconds). |
Definition at line 599 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.StopColorPulse | ( | ) |
Stops text color pulsing and restores the base foreground color.
Definition at line 550 of file TextBlock.cs.
|
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.
| tick | High-resolution tick value for this frame. |
Reimplemented from Gondwana.Drawing.Direct.DirectDrawingMovableBase.
Definition at line 690 of file TextBlock.cs.
| TextBlock Gondwana.Drawing.Direct.TextBlock.UseOutline | ( | bool | enable = true | ) |
Enables or disables a 1-pixel outline stroke around the text glyphs.
| enable | True to enable an outline; false to disable. |
Definition at line 491 of file TextBlock.cs.
| 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)).
| enable | True to enable the shadow; false to disable. |
Definition at line 446 of file TextBlock.cs.
|
get |
Gets the horizontal alignment used when drawing lines.
Definition at line 1201 of file TextBlock.cs.
|
get |
Gets the vertical alignment used when drawing lines.
Definition at line 1204 of file TextBlock.cs.
|
get |
Gets the configured background color.
Definition at line 1165 of file TextBlock.cs.
|
get |
Gets the requested font size (before any auto-shrink adjustments).
Definition at line 1168 of file TextBlock.cs.
|
get |
Gets the configured foreground (text) color.
Definition at line 1162 of file TextBlock.cs.
|
getset |
Gets or sets the horizontal padding (in pixels) on both left and right sides of the text.
Definition at line 203 of file TextBlock.cs.
|
get |
Gets the measured line height (in pixels) used for drawing.
Definition at line 1159 of file TextBlock.cs.
|
get |
Gets the laid-out lines (after wrapping and paragraph processing).
Definition at line 1156 of file TextBlock.cs.
|
getset |
Gets or sets a scale factor applied to the computed line height (1.0 = natural spacing).
Definition at line 198 of file TextBlock.cs.
|
get |
Gets the optional maximum number of lines to draw (or null for no limit).
Definition at line 1183 of file TextBlock.cs.
|
get |
Gets the optional minimum font size used by auto-shrink (or null if disabled).
Definition at line 1171 of file TextBlock.cs.
|
get |
Gets a value indicating whether an outline stroke is enabled.
Definition at line 1177 of file TextBlock.cs.
|
get |
Gets a value indicating whether punctuation pauses are enabled.
Definition at line 1228 of file TextBlock.cs.
|
get |
Gets the starting color for the pulse effect.
Definition at line 1210 of file TextBlock.cs.
|
get |
Gets the pulse period in seconds.
Definition at line 1216 of file TextBlock.cs.
|
get |
Gets a value indicating whether color pulsing is enabled.
Definition at line 1207 of file TextBlock.cs.
|
get |
Gets the ending color for the pulse effect.
Definition at line 1213 of file TextBlock.cs.
|
get |
Gets the pulse waveform currently in use.
Definition at line 1219 of file TextBlock.cs.
|
get |
Gets the long punctuation pause duration (seconds) used for '.', '!', '?'.
Definition at line 1231 of file TextBlock.cs.
|
get |
Gets the short punctuation pause duration (seconds) used for ',', ';', ':'.
Definition at line 1234 of file TextBlock.cs.
|
get |
Gets the currently resolved (effective) foreground color used for drawing.
Definition at line 1237 of file TextBlock.cs.
|
get |
Gets the shadow opacity (0-255).
Definition at line 1195 of file TextBlock.cs.
|
get |
Gets the blur radius for the shadow (sigma, in pixels).
Definition at line 1198 of file TextBlock.cs.
|
get |
Gets the horizontal shadow offset (in pixels).
Definition at line 1189 of file TextBlock.cs.
|
get |
Gets the vertical shadow offset (in pixels).
Definition at line 1192 of file TextBlock.cs.
|
get |
Gets a value indicating whether a drop shadow is enabled.
Definition at line 1186 of file TextBlock.cs.
|
get |
Gets the current raw text content.
Definition at line 1153 of file TextBlock.cs.
|
get |
Gets the active text reveal mode.
Definition at line 1222 of file TextBlock.cs.
|
get |
Gets the configured reveal rate (characters/sec or words/sec depending on mode).
Definition at line 1225 of file TextBlock.cs.
|
get |
Gets the configured typeface (or null to use SKTypeface.Default).
Definition at line 1174 of file TextBlock.cs.
|
getset |
Gets or sets the vertical padding (in pixels) on both top and bottom sides of the text.
Definition at line 208 of file TextBlock.cs.
|
getsetadd |
Gets or sets extra scrollable space after the final laid-out line.
Applied only when the text already exceeds the available height. This lets dense diagnostics and log views move the final glyph descent clear of the clip edge.
Definition at line 240 of file TextBlock.cs.
|
getset |
Gets or sets the vertical text-content scroll offset in native pixels.
The offset is applied after text layout and is clipped to this text block's bounds. Use MeasureMaximumVerticalScrollOffsetPx to determine the valid upper bound.
Definition at line 217 of file TextBlock.cs.
|
get |
Gets a value indicating whether word wrapping is enabled.
Definition at line 1180 of file TextBlock.cs.
| 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.
Definition at line 71 of file TextBlock.cs.
| 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).
Definition at line 64 of file TextBlock.cs.