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
| Property | Type | Default | Description |
|---|---|---|---|
TextAnimationBlueprint | TObjectPtr<UTextAnimationBlueprint> | — | the Blueprint asset driving the animation |
ParameterOverrides | TObjectPtr<UAnimParameterOverrides> | — | instance-level parameter overrides (Instanced) |
bAutoPlay | bool | false | auto-play after initialization |
bLoopPlayback | bool | false | loop playback |
Playback Control (BlueprintCallable)
| Function | DisplayName | Description |
|---|---|---|
Play() | Play | starts the per-glyph reveal animation |
Pause() | Pause | pauses playback |
Resume() | Resume | resumes paused playback |
Stop() | Stop | stops and resets the animation |
SkipToEnd() | Skip to End | skips the animation and displays all text |
IsAnimating() | Is Animating | BlueprintPure, whether playing |
Blueprint Variable Setters (6 Overloads)
| Function | Type | DisplayName |
|---|---|---|
SetBlueprintVariable(FName, float) | float | Set Blueprint Variable |
SetBlueprintVariable_Int(FName, int32) | int32 | Set Blueprint Variable (Int) |
SetBlueprintVariable_Bool(FName, bool) | bool | Set Blueprint Variable (Bool) |
SetBlueprintVectorVariable(FName, FVector) | FVector | Set Blueprint Variable (Vector) |
SetBlueprintColorVariable(FName, FLinearColor) | FLinearColor | Set Blueprint Variable (Color) |
SetBlueprintVector2DVariable(FName, FVector2D) | FVector2D | Set Blueprint Variable (Vector2D) |
Blueprint Delegates (BlueprintAssignable)
| Delegate | Signature | Description |
|---|---|---|
OnCharacterRevealedBP | FOnAnimTextCharRevealedBP(int32 RevealedCount) | fires on glyph reveal (callback with the revealed count) |
OnAnimationCompleteBP | FOnAnimTextAnimationCompleteBP | fires when the animation completes |
NOTE
Text content is set through the
Textproperty of theUTextBlockbase class; the widget caches it internally asFullTextand triggers compilation and playback inSynchronizeProperties().
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
| Property | Type | Default | Description |
|---|---|---|---|
AnimationData | TObjectPtr<UTextAnimationDataAsset> | — | tag → animation Blueprint mapping data asset |
bAutoPlay | bool | false | auto-play after initialization |
bLoopPlayback | bool | false | loop playback |
bSequentialPlayback | bool | false | sequential 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)
| Delegate | Signature | Description |
|---|---|---|
OnCharacterRevealedBP | FOnCharacterRevealedBP(int32 CharIndex, FString Character) | fires on glyph reveal (code point index + character) |
OnAnimationCompleteBP | FOnAnimatedRichTextAnimationCompleteBP | fires when the animation completes |
NOTE
Style sets, decorators, data tables, text shaping, and auto-wrapping are inherited from the
URichTextBlockbase class — the plugin does not re-implement them. Internally the privateFRichTextMarshaller/SAnimatedRichTextBlockcomplete 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
| Method | Description |
|---|---|
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)
| Function | DisplayName | Description |
|---|---|---|
Play() | Play | starts playback |
Pause() | Pause | pauses time advancement |
Resume() | Resume | resumes playback |
Stop() | Stop | stops and resets |
RevealAll() | Reveal All | immediately reveals all glyphs |
SetPlayDirection(EStagePlayDirection) | Set Play Direction | Forward / Reverse / PingPong |
SetLoop(bool) | Set Loop | enables loop playback |
TickAnimation(float DeltaTime) | Tick Animation | advances the animation clock per frame |
EvaluateAllGlyphs(TArray<FGlyphAnimationState>& OutStates) | Evaluate All Glyphs | batch evaluation of all glyph states |
Queries (BlueprintPure)
| Function | DisplayName | Returns |
|---|---|---|
IsPlaying() | Is Playing | bool |
IsComplete() | Is Complete | bool |
GetCurrentStage() | Get Current Stage | EAnimationStage |
GetStageTime() | Get Stage Time | float |
GetRevealedGlyphCount() | Get Revealed Count | int32 |
GetTotalGlyphCount() | Get Total Glyph Count | int32 |
Delegates (C++ Multicast)
| 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 |
TIP
With play direction
Reverse/PingPong, the controller wraps evaluation by the stage clock; theRevealedGlyphFlagsbitmap guarantees deduplicatedOnGlyphRevealedbroadcasts.
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
| Method | Description |
|---|---|
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
| Method | Description |
|---|---|
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
| Property | Type | Description |
|---|---|---|
Tracks | TArray<FTextAnimationTrack> | legacy track array (@deprecated, kept for compatibility) |
GlyphAnimations | TArray<TObjectPtr<UGlyphAnimation>> | glyph animation asset list (managed by the animation panel) |
StageTransitionConfig | FStageTransitionConfig | stage transition CrossFade configuration (participates in fingerprint hashing) |
VariableNameToGuidMap | TMap<FName, FGuid> | variable name → GUID mapping (stable identity) |
CompileCount | uint32 | compile counter (increments on every compile, participates in fingerprint hashing) |
Functions
| Method | Description |
|---|---|
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)
| Function | Type | DisplayName |
|---|---|---|
SetBlueprintVariable(FName, float) | float | Set Blueprint Variable |
SetBlueprintVectorVariable(FName, FVector) | FVector | Set Blueprint Variable (Vector) |
SetBlueprintColorVariable(FName, FLinearColor) | FLinearColor | Set Blueprint Variable (Color) |
SetBlueprintVector2DVariable(FName, FVector2D) | FVector2D | Set Blueprint Variable (Vector2D) |
NOTE
UTextAnimInstanceprovides only 4 overloads (float / FVector / FLinearColor / FVector2D); int32 and bool Blueprint variables are written by the widget-levelUAnimatedTextBlockoverloads.
Scheduling & Stage Building
| Function | Description |
|---|---|
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
| Function | Description |
|---|---|
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
| Member | Type | Description |
|---|---|---|
SourceBlueprint | TObjectPtr<UTextAnimationBlueprint> | source Blueprint asset reference |
CharCount | int32 | glyph count at edit time |
CachedBakedAnimation | FBakedAnimation | cached baked animation data |
bHasBakedAnimation | bool | whether baked data is ready |
CachedBlueprintFingerprint | uint64 | Blueprint 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
| Function | Description |
|---|---|
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 onGetSignature()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.