Event System

Texturge provides extension points at key animation lifecycle moments through BlueprintNativeEvent (override events) and BlueprintAssignable delegates (binding events).

BuildDefaultAnimation Event

Applies to: overriding the bake logic in the animation Blueprint event graph to orchestrate animations dynamically based on text content.

BuildDefaultAnimation is a BlueprintNativeEvent on UTextAnimInstance, invoked by FAnimationCompiler::BakeAllStages during baking.

Signature

UFUNCTION(BlueprintNativeEvent,
    meta = (DisplayName = "构建默认动画", ReturnDisplayName = "Baked Stage"))
FBakedStage BuildDefaultAnimation(
    UPARAM(DisplayName = "Glyph Count") int32 GlyphCount,
    UPARAM(DisplayName = "Text") const FString& Text);

Parameters & Return Value

  • GlyphCount — the number of glyphs in the text (code point count)
  • Text — the source text at compile time
  • ReturnFBakedStage (default stage baked data, fully UPROPERTY-composed, Kismet compiler safe)

Overriding

  1. Switch the animation Blueprint editor to Graph mode
  2. Right-click in the event graph → OverrideBuild Default Animation
  3. Add the Event BuildDefaultAnimation node (carries GlyphCount / Text inputs)
  4. Chain Layer / Factory nodes (see”Blueprint Node Reference”)
  5. Connect the Bake node’s output to the return pin
images/build-default-animation-override.png — Blueprint screenshot: overridden Event BuildDefaultAnimation node in Graph mode with GlyphCount/Text inputs, event graph wiring BuildScheduleInfos → CreateLayer → chained tweaks → CreateFactory → AddLayer → Bake → return

Use Cases

  • Adjust stagger rhythm dynamically by text length (short text fast, long text slow)
  • Differentiated scheduling per glyph classification (skip whitespace, punctuation delay)
  • Multi-layer combinations (base layer + shake + tint)

NOTE

BuildDefaultAnimation fires once during baking and does not re-run at runtime. For dynamic runtime adjustments use Set Blueprint Variable (triggers a cooldown re-bake) or the widget’s playback controls.

Widget Blueprint Delegates (BlueprintAssignable)

Applies to: binding glyph reveal and animation completion events in a Widget Blueprint.

UAnimatedTextBlock

EventSignatureWhen it fires
Glyph Revealed (Blueprint)int32 RevealedCounteach glyph reveal (cumulative revealed count)
Animation Complete (Blueprint)playback finished

UAnimatedRichTextBlock

EventSignatureWhen it fires
Glyph Revealed (Blueprint)int32 CharIndex, FString Charactereach glyph reveal (code point index + character)
Animation Complete (Blueprint)playback finished

Binding: drag out from the widget pin → Assign Glyph Revealed (Blueprint) → custom event.

Controller C++ Delegates

Applies to: listening to controller lifecycle on the manual (C++) path.

UTextAnimationStageController exposes 3 C++ multicast delegates (not dynamic delegates; Blueprint must go through the widget proxies):

DelegateSignatureWhen it fires
OnGlyphRevealed(int32 GlyphIndex, TCHAR Character)glyph revealed for the first time (reverse playback clearing the bit can broadcast again)
OnStageChanged(EAnimationStage From, EAnimationStage To)stage transition
OnAnimationComplete()animation complete
Controller->OnStageChanged.AddLambda([](EAnimationStage From, EAnimationStage To)
{
    UE_LOG(LogTexturge, Log, TEXT("Stage: %d%d"), (int32)From, (int32)To);
});

Stage Transition Flow

Stopped → Play() → Playing
  → Default stage advances (TickAnimation → TransitionTo detects boundaries)
  → OnStageChanged(From, To) broadcast
  → all stages complete → OnAnimationComplete → Complete

Queries & Evaluation

Applies to: getting stage state and glyph state on the C++ manual path.

UTextAnimationStageController* Controller = /* manually created controller */;
if (Controller)
{
    Controller->TickAnimation(DeltaTime);                    // advance the clock

    // Single-glyph evaluation (returns current state)
    FGlyphAnimationState State = Controller->EvaluateGlyph(GlyphIndex);

    // Stage queries
    EAnimationStage Stage = Controller->GetCurrentStage();
    float StageTime = Controller->GetStageTime();
    int32 Revealed = Controller->GetRevealedGlyphCount();
}

NOTE

On the widget path GetStageController() is a C++ accessor for editor preview — in Blueprint use the widget’s own playback control nodes and delegates; do not bypass the widget to manipulate its internal controller directly.

Common Event-Driven Scenarios

Applies to: implementing interaction patterns such as typewriter sound effects, dialog advancement, UI prompts, and skip functionality.

  1. Typewriter sounds — use UEventSoundComponent (Set Glyph Sound + Bind Animator) or bind the Glyph Revealed (Blueprint) event, instead of polling every frame in Tick
  2. Dialog advancement — the Animation Complete (Blueprint) event triggers the next dialog line / shows a “Continue” prompt
  3. Typing progress counterUAnimatedTextBlock’s RevealedCount parameter drives the typewriter caret / progress bar
  4. Skip functionality — an input event calls Skip to End to skip the current typewriter animation
  5. Per-glyph logicUAnimatedRichTextBlock’s CharIndex + Character parameters enable per-character effects / punctuation pauses

TIP

For typewriter sounds, trigger the sound in the Glyph Revealed (Blueprint) event rather than per-frame Tick polling to reduce unnecessary performance overhead. The event parameters (code point index + character) already include the triggering position.

images/event-graph-binding.png — Event binding blueprint example: Assign OnCharacterRevealedBP wired to a custom event (RevealedCount driving a progress bar) on the left, Assign OnAnimationCompleteBP wired to dialog advancement on the right