Skip to content

Combat Text Types

MageItCombatTextTypes.h defines the data structures passed between the subsystem, the renderers, and (for the Slate renderer) its per-event animation state.


(Blueprint Type)

The payload passed to AddDamageEvent and RenderDamage. This is the one struct every renderer consumes, regardless of backend.

  • Location (Vector): World-space spawn position for the combat text.
  • DamageAmount (Float): The numeric value to display. Also drives Niagara sprite/scale lookups by default.
  • DamageTag (GameplayTag): Determines which renderer instance handles this event. See GetRenderer for the tag-hierarchy resolution rules.
  • TargetActor (Actor*): The actor this number belongs to. Required by the UMG renderer for widget tracking and damage accumulation.
  • HitInfo (FHitResult): Optional hit data. The UMG renderer falls back to HitInfo.GetActor() when TargetActor isn’t set.

(Blueprint Type)

Per-event animation state maintained by UMageItCombatTextRendererSlate while a number is animating. One instance exists per currently-visible Slate combat text number, stored in the renderer’s ActiveEvents array.

  • Payload (FMageItCombatTextEvent): The original event this animation state was created from.
  • ElapsedTime (Float): Seconds since the event started animating.
  • AnimationDuration (Float): Total lifetime of the animation, after which the event is removed.
  • CurrentOpacity / CurrentScale (Float): The values computed each tick by ProcessDefaultAnimation (or your override), consumed directly by the canvas paint pass.
  • TargetScale (Float): The steady-state scale the pop-in/pop-out phases animate towards. Defaults to 1.0.
  • Gravity (Vector2D): Constant screen-space acceleration applied over the event’s lifetime.
  • DriftDirection (Vector2D): Constant screen-space velocity applied over the event’s lifetime, randomized per-event by GetVelocityDirection.
  • ScreenPosition (Vector2D): The final computed screen position for this frame.
  • CachedTextSize (Vector2D): The measured size of CombatText in TextFont, used to center the text on its pivot. Cached once per unique string by the renderer to avoid repeated FSlateFontMeasure calls.
  • CombatText (String): The text string being displayed, produced by ExtractCombatText.
  • TextColor / ShadowColor (LinearColor): Resolved once at creation via ExtractTextColor / ExtractShadowColor.

Internal bookkeeping struct used by UMageItCombatTextRendererUMG to track a pooled widget’s position relative to its target actor. Not exposed to Blueprint (USTRUCT() without BlueprintType).

struct FMageItWidgetTrackingData
{
TObjectPtr<UMageItCombatTextWidget> Widget = nullptr;
FVector CurrentWorldPosition = FVector::ZeroVector;
FVector TargetWorldPosition = FVector::ZeroVector;
FVector PreviousActorLocation = FVector::ZeroVector;
};