Core Runtime Classes

The runtime module (Source/Texturge/Public) provides the following core classes, organized by inheritance into the UObject hierarchy, the UMG widget hierarchy, and pure C++ utilities.

Class Hierarchy

UObject
├── UTextAnimationBlueprint          (UBlueprint)      — animation Blueprint asset
├── UTextAnimationBlueprintGeneratedClass (UBlueprintGeneratedClass) — generated class of compile output
├── UTextAnimInstance                — Blueprint instance (bake cache + BuildDefaultAnimation event)
├── UTextAnimationStageController    — stage controller (runtime playback engine)
├── UTextAnimator                    — typewriter pipeline engine (rich text path)
├── UGlyphAnimation                  (UMovieSceneSequence) — glyph animation curve asset
├── UGlyphAnimationLayer             — layer wrapper (curve copy + scheduling + tweaks)
├── UGlyphAnimationFactory           — multi-layer merge baker
├── UTextAnimationDataAsset          (UDataAsset)      — rich text tag → animation mapping
├── UAnimParameterOverrides          — instance-level parameter override container
├── UDialogWidget                    (UUserWidget)     — dialog widget
├── UEventSoundComponent             (UActorComponent) — event sound component
└── ULocalizationSubsystem           (UGameInstanceSubsystem) — localization subsystem

UMG widget hierarchy
├── UAnimatedTextBlock               (UTextBlock)      — plain text animation widget
└── UAnimatedRichTextBlock           (URichTextBlock)  — rich text animation widget

Pure C++ utilities
├── FAnimationCompiler               — static compile functions
├── FGlyphScheduleBuilder            — schedule building utility
└── FTagParser / FRenderTreeBuilder  — rich text parsing and render tree building

UAnimatedTextBlock

A UMG widget inheriting UTextBlock that internally holds a UTextAnimationStageController and manages its lifecycle automatically. Supports per-glyph typewriter animation, loop playback, and runtime Blueprint variable overrides.

UCLASS(BlueprintType, Blueprintable, meta = (DisplayName = "动画文本块"))
class TEXTURGE_API UAnimatedTextBlock : public UTextBlock

Configuration Properties

PropertyTypeDefaultDescription
TextAnimationBlueprintTObjectPtr<UTextAnimationBlueprint>the Blueprint asset driving the animation
ParameterOverridesTObjectPtr<UAnimParameterOverrides>instance-level parameter overrides (Instanced)
bAutoPlayboolfalseauto-play after initialization
bLoopPlaybackboolfalseloop playback

Playback Control (BlueprintCallable)

FunctionDisplayNameDescription
Play()Playstarts the per-glyph reveal animation
Pause()Pausepauses playback
Resume()Resumeresumes paused playback
Stop()Stopstops and resets the animation
SkipToEnd()Skip to Endskips the animation and displays all text
IsAnimating()Is AnimatingBlueprintPure, whether playing

Blueprint Variable Setters (6 Overloads)

FunctionTypeDisplayName
SetBlueprintVariable(FName, float)floatSet Blueprint Variable
SetBlueprintVariable_Int(FName, int32)int32Set Blueprint Variable (Int)
SetBlueprintVariable_Bool(FName, bool)boolSet Blueprint Variable (Bool)
SetBlueprintVectorVariable(FName, FVector)FVectorSet Blueprint Variable (Vector)
SetBlueprintColorVariable(FName, FLinearColor)FLinearColorSet Blueprint Variable (Color)
SetBlueprintVector2DVariable(FName, FVector2D)FVector2DSet Blueprint Variable (Vector2D)

Blueprint Delegates (BlueprintAssignable)

DelegateSignatureDescription
OnCharacterRevealedBPFOnAnimTextCharRevealedBP(int32 RevealedCount)fires on glyph reveal (callback with the revealed count)
OnAnimationCompleteBPFOnAnimTextAnimationCompleteBPfires when the animation completes

NOTE

Text content is set through the Text property of the UTextBlock base class; the widget caches it internally as FullText and triggers compilation and playback in SynchronizeProperties().

UAnimatedRichTextBlock

Inherits URichTextBlock and drives rich text per-glyph animation with UTextAnimator. Tags map to animation Blueprints through UTextAnimationDataAsset, supporting multi-entry sequential/simultaneous playback.

UCLASS(meta = (DisplayName = "动画多格式文本块"))
class TEXTURGE_API UAnimatedRichTextBlock : public URichTextBlock

Configuration Properties

PropertyTypeDefaultDescription
AnimationDataTObjectPtr<UTextAnimationDataAsset>tag → animation Blueprint mapping data asset
bAutoPlayboolfalseauto-play after initialization
bLoopPlaybackboolfalseloop playback
bSequentialPlaybackboolfalsesequential playback (entries play one after another when on; simultaneously when off)

Playback Control (BlueprintCallable)

Play() / Pause() / Resume() / Stop() / SkipToEnd() / IsAnimating() — isomorphic to UAnimatedTextBlock.

Blueprint Delegates (BlueprintAssignable)

DelegateSignatureDescription
OnCharacterRevealedBPFOnCharacterRevealedBP(int32 CharIndex, FString Character)fires on glyph reveal (code point index + character)
OnAnimationCompleteBPFOnAnimatedRichTextAnimationCompleteBPfires when the animation completes

NOTE

Style sets, decorators, data tables, text shaping, and auto-wrapping are inherited from the URichTextBlock base class — the plugin does not re-implement them. Internally the private FRichTextMarshaller / SAnimatedRichTextBlock complete per-glyph rendering.

UTextAnimationStageController

The central scheduling unit of runtime animation — a data-driven controller (not a widget) managing playback, pause, stage transitions, and evaluation of FBakedAnimation.

UCLASS(BlueprintType, meta = (DisplayName = "文本动画阶段控制器"))
class TEXTURGE_API UTextAnimationStageController : public UObject

C++ Injection Interfaces

MethodDescription
Initialize(const FBakedAnimation* InAnimation, UTextAnimationBlueprint* InBlueprint)injects baked data and the source Blueprint reference
PublishBakedAnimation(const FBakedAnimation& NewAnimation)publishes new baked animation (GameThread safe)
EvaluateGlyph(int32 GlyphIndex)evaluates a single glyph, returning FGlyphAnimationState

Playback Control (BlueprintCallable)

FunctionDisplayNameDescription
Play()Playstarts playback
Pause()Pausepauses time advancement
Resume()Resumeresumes playback
Stop()Stopstops and resets
RevealAll()Reveal Allimmediately reveals all glyphs
SetPlayDirection(EStagePlayDirection)Set Play DirectionForward / Reverse / PingPong
SetLoop(bool)Set Loopenables loop playback
TickAnimation(float DeltaTime)Tick Animationadvances the animation clock per frame
EvaluateAllGlyphs(TArray<FGlyphAnimationState>& OutStates)Evaluate All Glyphsbatch evaluation of all glyph states

Queries (BlueprintPure)

FunctionDisplayNameReturns
IsPlaying()Is Playingbool
IsComplete()Is Completebool
GetCurrentStage()Get Current StageEAnimationStage
GetStageTime()Get Stage Timefloat
GetRevealedGlyphCount()Get Revealed Countint32
GetTotalGlyphCount()Get Total Glyph Countint32

Delegates (C++ Multicast)

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

TIP

With play direction Reverse / PingPong, the controller wraps evaluation by the stage clock; the RevealedGlyphFlags bitmap guarantees deduplicated OnGlyphRevealed broadcasts.

UTextAnimator

Typewriter pipeline engine designed for UAnimatedRichTextBlock. All plain C++ methods, no Blueprint nodes exposed — called internally by the widget.

UCLASS(meta = (DisplayName = "文本动画器", ToolTip = "打字机动画管线引擎"))
class TEXTURGE_API UTextAnimator : public UObject

Input Setters

MethodDescription
SetPlainText(const FString&)sets plain text (non-RichText path)
SetRichText(const FString&)sets rich text (render-tree-driven pipeline)
SetAnimationData(UTextAnimationDataAsset*)sets the entry mapping asset (rich text path)
SetAnimationBlueprint(UTextAnimationBlueprint*)sets a single Blueprint (plain text path)
SetPlaybackMode(EPlaybackMode)Duration / CPS mode
SetCPS(float)glyphs per second (CPS ≥ 1.0)
SetPlayMode(EPlayMode)Forward / Reverse / PingPong
SetPlaySpeedMultiplier(float)playback speed multiplier
SetSequentialPlayback(bool)sequential multi-entry playback
SetMaxLoopCount(int32)max loop count (≤0 infinite)

Playback Control

StartAnimating(bool bRevealAll = false) / TickAnimation(float) / Pause() / Resume() / Stop() / SkipToEnd()

Data Queries

MethodDescription
IsAnimating()whether playing
GetCurrentCharIndex()current code point index
GetCharacterCount()total code point count
GetGlyphIndexForCodeUnit(int32)code unit → glyph mapping (both units of a surrogate pair map to the same glyph)
GetCurrentFrameData(int32)current frame state of a single glyph (unrevealed glyphs return the identity frame)
GetCurrentFrameDataArray()current frame array of all glyphs (render cache)
GetAccumulatedLetterSpacing(int32)accumulated letter spacing
SetPreviewFrameDataOverride(const TArray<FGlyphAnimationState>&)editor preview frame data injection

Test Injection Interfaces

SetAnimInstance(UTextAnimInstance*) / SetEntryAnimInstance(int32, UTextAnimInstance*) — dual injection interfaces making the playback engine testable without compiled Blueprints.

UTextAnimationBlueprint

The animation Blueprint asset, inheriting UBlueprint. Designers add UGlyphAnimation curve assets, configure stage transitions, and declare Blueprint variables (Blueprint variables as parameters) in the editor.

UCLASS(BlueprintType, meta = (DisplayName = "文本动画蓝图"))
class TEXTURGE_API UTextAnimationBlueprint : public UBlueprint

Properties

PropertyTypeDescription
TracksTArray<FTextAnimationTrack>legacy track array (@deprecated, kept for compatibility)
GlyphAnimationsTArray<TObjectPtr<UGlyphAnimation>>glyph animation asset list (managed by the animation panel)
StageTransitionConfigFStageTransitionConfigstage transition CrossFade configuration (participates in fingerprint hashing)
VariableNameToGuidMapTMap<FName, FGuid>variable name → GUID mapping (stable identity)
CompileCountuint32compile counter (increments on every compile, participates in fingerprint hashing)

Functions

MethodDescription
GetTotalDuration()BlueprintPure, total duration of all tracks
GetTrackById(const FGuid&)BlueprintPure, track index by ID (-1 if not found)
CreateAnimInstance()creates a UTextAnimInstance instance
OnVariableAdded/Renamed/Removed(FName)Blueprint variable change notifications (editor-internal)

UTextAnimInstance

Blueprint-generated instance (the CDO is the bake cache holder). The C++ layer provides no predefined variables — designers declare variables in the Blueprint Class Defaults and read them in the BuildDefaultAnimation event.

UCLASS(BlueprintType, meta = (DisplayName = "文本动画实例"))
class TEXTURGE_API UTextAnimInstance : public UObject

Blueprint Variable Setters (4 Overloads)

FunctionTypeDisplayName
SetBlueprintVariable(FName, float)floatSet Blueprint Variable
SetBlueprintVectorVariable(FName, FVector)FVectorSet Blueprint Variable (Vector)
SetBlueprintColorVariable(FName, FLinearColor)FLinearColorSet Blueprint Variable (Color)
SetBlueprintVector2DVariable(FName, FVector2D)FVector2DSet Blueprint Variable (Vector2D)

NOTE

UTextAnimInstance provides only 4 overloads (float / FVector / FLinearColor / FVector2D); int32 and bool Blueprint variables are written by the widget-level UAnimatedTextBlock overloads.

Scheduling & Stage Building

FunctionDescription
BuildScheduleInfos(const FString& Text)static BlueprintCallable, iterates code points generating TArray<FGlyphScheduleInfo> (prefilled index, character, and glyph classification)
BuildDefaultAnimation(int32 GlyphCount, const FString& Text)BlueprintNativeEvent, override this event to customize the default stage animation, returning FBakedStage

Queries & Others

FunctionDescription
GetAnimationByName(FName)finds a UGlyphAnimation by name from the Blueprint asset
GetCharacterCount()BlueprintPure, character count of the currently compiled text
EvaluateBaked(float InTime)evaluates with cached baked data, returning all glyph frame data
ResolveAnimationReferences()syncs Blueprint variable values from the Blueprint asset
PostInitProperties()lifecycle hook

Data Members

MemberTypeDescription
SourceBlueprintTObjectPtr<UTextAnimationBlueprint>source Blueprint asset reference
CharCountint32glyph count at edit time
CachedBakedAnimationFBakedAnimationcached baked animation data
bHasBakedAnimationboolwhether baked data is ready
CachedBlueprintFingerprintuint64Blueprint fingerprint cache

UGlyphAnimation

Glyph animation curve asset inheriting UMovieSceneSequence. Each asset is internally a UMovieScene storing 21 channels of keyframes through UMovieSceneGlyphAnimationTrack.

UCLASS(BlueprintType, MinimalAPI, meta = (DisplayName = "字形动画"))
class TEXTURGE_API UGlyphAnimation : public UMovieSceneSequence

Blueprint Functions

FunctionDescription
GetDuration()BlueprintPure, total animation duration (seconds)
GetTrackTypes()returns TArray<ETextAnimationTrackType>, the track types in the animation
HasTrackType(ETextAnimationTrackType)checks whether the given track type exists

NOTE

Curve extraction (FAnimationCompiler::ExtractCurves) caches on GetSignature() of all Tracks/Sections in the MovieScene; signature changes after Sequencer edits invalidate automatically.

UAnimParameterOverrides

Per-widget-instance (Instanced per-widget) parameter override container storing Blueprint variable name → instance-level override value mappings.

UCLASS(meta = (DisplayName = "动画参数覆盖"))
class TEXTURGE_API UAnimParameterOverrides : public UObject
{
    TMap<FName, float>         FloatOverrides;
    TMap<FName, int32>         IntOverrides;
    TMap<FName, bool>          BoolOverrides;
    TMap<FName, FVector>       VectorOverrides;
    TMap<FName, FLinearColor>  ColorOverrides;
    TMap<FName, FVector2D>     Vector2DOverrides;
};

At bake time the ApplyAnimParamOverridesToInstance<Owner> template (AnimParamOverrideUtils.h) writes overrides into the bake temporary instance. TAnimParamTraits<T, Owner> provides compile-time mapping from C++ types to TMap members; adding a type only requires a TMap field + one DECLARE_ANIM_PARAM_TRAIT specialization.

images/runtime-classes.png — Runtime class relationship diagram: UTextAnimationBlueprint → FAnimationCompiler → FBakedAnimation (with three FBakedStage and FBakedGlyph multi-layer FPerLayerCurves), UAnimatedTextBlock driven by UTextAnimationStageController on the left, UAnimatedRichTextBlock driven by UTextAnimator on the right, UAnimParameterOverrides Instanced on widgets at the bottom