UMageItCombatTextRendererUMG
Base Class: UMageItCombatTextRendererBase
Interfaces: FTickableGameObject
Overview
Section titled “Overview”UMageItCombatTextRendererUMG renders combat text as pooled UMageItCombatTextWidget instances
placed directly in the viewport. It is the most flexible renderer — full UMG animation, easy per-widget Blueprint
logic — at the cost of one pooled widget per concurrent on-screen number.
Its defining feature is damage accumulation: repeated hits on the same TargetActor update the same widget
instead of spawning a new one, growing the displayed number and resetting its fade-out timer.
Configuration Properties
Section titled “Configuration Properties”PoolSize(Integer,EditDefaultsOnly, min1): Number of widgets pre-allocated atInitialize. Default10.MaxPoolSize(Integer,EditDefaultsOnly, min0): Hard ceiling on total widget count (including the initialPoolSize) the pool may grow to when exhausted, instead of dropping the damage event.0= unbounded growth. Values belowPoolSizehave no effect.LocationInterpSpeed(Float,EditDefaultsOnly): Interpolation speed used to smoothly move a widget’s tracked world position towards its target. Default15.0.bTrackActorLocation(Boolean,EditDefaultsOnly): Whether the widget follows itsTargetActoras it moves after spawning.bUpdateLocation(Boolean,EditDefaultsOnly): Whether new damage events on an already-active target update its tracked position.bSmoothLocationUpdate(Boolean,EditDefaultsOnly): When a new event updates the position, whether to interpolate towards it (true) or snap immediately (false).ScreenLocationOffset(Vector2D,EditDefaultsOnly): Constant pixel offset applied to the final projected screen position.WidgetClass(TSubclassOf<UMageItCombatTextWidget>,EditDefaultsOnly): The widget class instantiated for the pool.
Read-Only / Internal
Section titled “Read-Only / Internal”WidgetPool(Array<UMageItCombatTextWidget*>): Widgets available for reuse.ActiveWidgets(Map<WeakObjectPtr<AActor>, FMageItWidgetTrackingData>): Widgets currently assigned to a target actor. SeeFMageItWidgetTrackingData.
Methods (Functions)
Section titled “Methods (Functions)”ReturnWidgetToPool
Section titled “ReturnWidgetToPool”void ReturnWidgetToPool(UMageItCombatTextWidget* Widget);(Blueprint Callable) Pushes Widget back onto WidgetPool and removes it from ActiveWidgets. Called
automatically by UMageItCombatTextWidget::FadeOut — you normally don’t call this directly.
Lifecycle Overrides
Section titled “Lifecycle Overrides”Initialize_Implementation
Section titled “Initialize_Implementation”Pre-allocates and hides PoolSize widgets, adding each to the viewport (Collapsed visibility, centered
alignment) so later reuse doesn’t pay CreateWidget cost.
RenderDamage_Implementation
Section titled “RenderDamage_Implementation”Resolves the target actor from EventData.TargetActor, falling back to EventData.HitInfo.GetActor().
- If the actor already has an active widget, calls
UpdateDamageon it (accumulation) and updates its tracked target position according tobUpdateLocation/bSmoothLocationUpdate. - Otherwise, pulls a widget from the pool (or grows the pool if under
MaxPoolSize) via the internalUseWidget, sets its initial position, and callsFadeIn. - If the pool is exhausted and can’t grow, logs a
Warningand drops the event.
For every active widget: optionally accumulates the target actor’s movement delta into a target position
(bTrackActorLocation), interpolates the widget’s current world position towards it (LocationInterpSpeed),
projects that position to screen space via PlayerController->ProjectWorldLocationToScreen, and calls
SetPositionInViewport (plus ScreenLocationOffset).
Shutdown_Implementation
Section titled “Shutdown_Implementation”Empties ActiveWidgets and removes every pooled widget from the viewport.