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
- Return —
FBakedStage(default stage baked data, fully UPROPERTY-composed, Kismet compiler safe)
Overriding
- Switch the animation Blueprint editor to Graph mode
- Right-click in the event graph → Override → Build Default Animation
- Add the
Event BuildDefaultAnimationnode (carriesGlyphCount/Textinputs) - Chain Layer / Factory nodes (see”Blueprint Node Reference”)
- Connect the
Bakenode’s output to the return pin
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
BuildDefaultAnimationfires once during baking and does not re-run at runtime. For dynamic runtime adjustments useSet 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
| Event | Signature | When it fires |
|---|---|---|
Glyph Revealed (Blueprint) | int32 RevealedCount | each glyph reveal (cumulative revealed count) |
Animation Complete (Blueprint) | — | playback finished |
UAnimatedRichTextBlock
| Event | Signature | When it fires |
|---|---|---|
Glyph Revealed (Blueprint) | int32 CharIndex, FString Character | each 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):
| Delegate | Signature | When 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.
- Typewriter sounds — use
UEventSoundComponent(Set Glyph Sound+Bind Animator) or bind theGlyph Revealed (Blueprint)event, instead of polling every frame in Tick - Dialog advancement — the
Animation Complete (Blueprint)event triggers the next dialog line / shows a “Continue” prompt - Typing progress counter —
UAnimatedTextBlock’sRevealedCountparameter drives the typewriter caret / progress bar - Skip functionality — an input event calls
Skip to Endto skip the current typewriter animation - Per-glyph logic —
UAnimatedRichTextBlock’sCharIndex + Characterparameters 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.