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

DelegateSignatureDisplayNameWhen it fires
OnCharacterRevealedBPFOnAnimTextCharRevealedBP(int32 RevealedCount)Glyph Revealed (Blueprint)on each glyph reveal (parameter is the cumulative revealed count)
OnAnimationCompleteBPFOnAnimTextAnimationCompleteBPAnimation 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

DelegateSignatureDisplayNameWhen it fires
OnCharacterRevealedBPFOnCharacterRevealedBP(int32 CharIndex, FString Character)Glyph Revealed (Blueprint)on each glyph reveal (code point index + character)
OnAnimationCompleteBPFOnAnimatedRichTextAnimationCompleteBPAnimation Complete (Blueprint)when playback finishes
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnCharacterRevealedBP, int32, CharIndex, FString, Character);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnAnimatedRichTextAnimationCompleteBP);

Blueprint Binding Steps

  1. Get the widget reference (UAnimatedTextBlock / UAnimatedRichTextBlock) in the event graph
  2. Drag out from the widget pin → search for Assign Glyph Revealed (Blueprint) or Assign Animation Complete (Blueprint)
  3. Connect the red event pin to a custom event node
  4. 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++):

DelegateSignatureWhen it fires
OnGlyphRevealedFOnGlyphRevealed(int32 GlyphIndex, TCHAR Character)glyph revealed for the first time; reverse playback clearing the bit can broadcast again
OnStageChangedFOnStageChanged(EAnimationStage From, EAnimationStage To)stage transition
OnAnimationCompleteFOnAnimationCompleteanimation 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);
ParameterTypeDescription
GlyphCountint32number of glyphs in the text
Textconst FString&source text
ReturnFBakedStagebaked data of the default stage (fully UPROPERTY-composed, Kismet compiler safe)

Blueprint Override Example

  1. In the animation Blueprint’s Graph mode: right-click the graph → OverrideBuild Default Animation
  2. Add the Event BuildDefaultAnimation node (carries GlyphCount / Text inputs automatically)
  3. Use the Build Schedule Info node to generate the FGlyphScheduleInfo array
  4. Chain: Create Glyph Animation Layer → scheduling / tweak nodes → Create FactoryAdd LayerBake
  5. Connect the Bake node’s FBakedStage output 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::BakeAllStages automatically 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 Variable node 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 after Initialize.

  1. Bind events after initialization: on the manual path, configure delegates after Initialize completes to avoid null references
  2. Use parameters to distinguish glyphs: the rich text path’s OnCharacterRevealedBP provides CharIndex + Character for per-character sounds / typewriter caret
  3. Drive game logic in OnAnimationCompleteBP: release resources, advance dialogs, or unlock UI after all animations finish
  4. Keep the chained return when overriding BuildDefaultAnimation: connect the Bake node output directly to the event’s return pin; do not wrap it
  5. Use SetBlueprintVariable for runtime parameters: call before Play to avoid mid-animation re-bake hitches
images/blueprint-events.png — Blueprint event wiring diagram: left shows BuildDefaultAnimation override event graph (BuildScheduleInfos → CreateLayer → chained tweaks → CreateFactory → Bake → return), right shows widget event binding (Assign OnCharacterRevealedBP and Assign OnAnimationCompleteBP to custom events)