Blueprint Event Reference
Texturge connects to Blueprint through a two-layer event mechanism: BlueprintAssignable delegates (bound directly in the event graph) and BlueprintNativeEvent (overridden in animation Blueprints).
Widget Blueprint Delegates
UAnimatedTextBlock
| Delegate | Signature | DisplayName | When it fires |
|---|---|---|---|
OnCharacterRevealedBP | FOnAnimTextCharRevealedBP(int32 RevealedCount) | Glyph Revealed (Blueprint) | on each glyph reveal (parameter is the cumulative revealed count) |
OnAnimationCompleteBP | FOnAnimTextAnimationCompleteBP | Animation Complete (Blueprint) | when playback finishes |
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnAnimTextCharRevealedBP, int32, RevealedCount);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnAnimTextAnimationCompleteBP);
UPROPERTY(BlueprintAssignable, Category = "Animation", meta = (DisplayName = "字形揭示(蓝图)"))
FOnAnimTextCharRevealedBP OnCharacterRevealedBP;
UPROPERTY(BlueprintAssignable, Category = "Animation", meta = (DisplayName = "动画完成(蓝图)"))
FOnAnimTextAnimationCompleteBP OnAnimationCompleteBP;
UAnimatedRichTextBlock
| Delegate | Signature | DisplayName | When it fires |
|---|---|---|---|
OnCharacterRevealedBP | FOnCharacterRevealedBP(int32 CharIndex, FString Character) | Glyph Revealed (Blueprint) | on each glyph reveal (code point index + character) |
OnAnimationCompleteBP | FOnAnimatedRichTextAnimationCompleteBP | Animation Complete (Blueprint) | when playback finishes |
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnCharacterRevealedBP, int32, CharIndex, FString, Character);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnAnimatedRichTextAnimationCompleteBP);
Blueprint Binding Steps
- Get the widget reference (
UAnimatedTextBlock/UAnimatedRichTextBlock) in the event graph - Drag out from the widget pin → search for
Assign Glyph Revealed (Blueprint)orAssign Animation Complete (Blueprint) - Connect the red event pin to a custom event node
- Read the output parameters in the custom event
Blueprint wiring example:
[AnimatedTextBlock Ref]
├── [Assign OnCharacterRevealedBP] ──→ [Custom Event: OnCharRevealed (RevealedCount)]
│ → [Print String "Revealed {RevealedCount}"]
│
└── [Assign OnAnimationCompleteBP] ──→ [Custom Event: OnDone]
→ [advance dialog / unlock UI]
Controller C++ Delegates
UTextAnimationStageController exposes 3 C++ multicast delegates (not dynamic delegates, not directly bindable in Blueprint — go through the widget proxies or bind in C++):
| Delegate | Signature | When it fires |
|---|---|---|
OnGlyphRevealed | FOnGlyphRevealed(int32 GlyphIndex, TCHAR Character) | glyph revealed for the first time; reverse playback clearing the bit can broadcast again |
OnStageChanged | FOnStageChanged(EAnimationStage From, EAnimationStage To) | stage transition |
OnAnimationComplete | FOnAnimationComplete | animation complete |
C++ binding example:
Controller->OnStageChanged.AddLambda([](EAnimationStage From, EAnimationStage To)
{
UE_LOG(LogTexturge, Log, TEXT("Stage: %d → %d"), (int32)From, (int32)To);
});
BuildDefaultAnimation (BlueprintNativeEvent)
The most central Blueprint event on UTextAnimInstance — designers override it in the animation Blueprint (Graph mode) to customize the complete default stage animation logic.
UFUNCTION(BlueprintNativeEvent,
meta = (DisplayName = "构建默认动画",
ToolTip = "构建默认动画阶段(可在蓝图中覆盖)",
ReturnDisplayName = "Baked Stage"))
FBakedStage BuildDefaultAnimation(
UPARAM(DisplayName = "Glyph Count") int32 GlyphCount,
UPARAM(DisplayName = "Text") const FString& Text);
| Parameter | Type | Description |
|---|---|---|
GlyphCount | int32 | number of glyphs in the text |
Text | const FString& | source text |
| Return | FBakedStage | baked data of the default stage (fully UPROPERTY-composed, Kismet compiler safe) |
Blueprint Override Example
- In the animation Blueprint’s Graph mode: right-click the graph →
Override→Build Default Animation - Add the
Event BuildDefaultAnimationnode (carriesGlyphCount/Textinputs automatically) - Use the
Build Schedule Infonode to generate theFGlyphScheduleInfoarray - Chain:
Create Glyph Animation Layer→ scheduling / tweak nodes →Create Factory→Add Layer→Bake - Connect the
Bakenode’sFBakedStageoutput to the return pin
Blueprint orchestration example:
[Event BuildDefaultAnimation (GlyphCount, Text)]
→ [Build Schedule Info (Text)] → Schedule
→ [Create Glyph Animation Layer (GlyphAnimations[0], Override, Schedule)] → Layer
→ [Set Glyph Delay (Layer, -1, 0.05)]
→ [Skip Glyph (Layer, -1)] ← skip whitespace
→ [Multiply Glyph Scale (Layer, 0, (1.2, 1.2))]
→ [Create Factory (Layer, Schedule)] → Factory
→ [Multiply Glyph Translation (Factory, -1, (2.0, 1.0))]
→ [Bake (Factory)] → Return Baked Stage
Default _Implementation
The C++ default implementation bakes through the Layer / Factory pipeline:
FBakedStage UTextAnimInstance::BuildDefaultAnimation_Implementation(int32 GlyphCount, const FString& Text)
{
TArray<FGlyphScheduleInfo> Schedule = BuildScheduleInfos(Text);
UGlyphAnimationLayer* BaseLayer = CreateLayer(GlyphAnimations[0], Override, Schedule);
UGlyphAnimationFactory* Factory = CreateFactory(BaseLayer, Schedule);
for (int32 i = 1; i < GlyphAnimations.Num(); ++i)
{
Factory->AddLayer(CreateLayer(GlyphAnimations[i], Additive, Schedule));
}
return Factory->Bake();
}
NOTE
If the Blueprint override returns an invalid result,
FAnimationCompiler::BakeAllStagesautomatically falls back to_Implementation.
Blueprint Variables as Parameters
Animation Blueprints predefine no C++ parameters. Designers declare variables in the Class Defaults and read them in the BuildDefaultAnimation event to configure scheduling:
- Supported variable types:
float/int32/bool/FVector/FLinearColor/FVector2D - Modified dynamically at runtime through the
Set Blueprint Variablenode family; after marking Dirty, an automatic re-bake occurs after the cooldown (MinFramesBetweenRebakes = 3)
Lifecycle & Event Wiring Best Practices
TIP
Widget events (
OnCharacterRevealedBP/OnAnimationCompleteBP) are bound automatically by the widget to the controller’s internal delegates — no manual controller lifecycle management needed; when creating a controller manually, bind C++ delegates afterInitialize.
- Bind events after initialization: on the manual path, configure delegates after
Initializecompletes to avoid null references - Use parameters to distinguish glyphs: the rich text path’s
OnCharacterRevealedBPprovidesCharIndex+Characterfor per-character sounds / typewriter caret - Drive game logic in OnAnimationCompleteBP: release resources, advance dialogs, or unlock UI after all animations finish
- Keep the chained return when overriding BuildDefaultAnimation: connect the
Bakenode output directly to the event’s return pin; do not wrap it - Use SetBlueprintVariable for runtime parameters: call before
Playto avoid mid-animation re-bake hitches