Skip to content

SeinARTS UI Library

Class · USeinUIBPFL : UBlueprintFunctionLibrary

#include "Lib/SeinUIBPFL.h"

Utility nodes for UI: entity name, icon, portrait and relation lookups, fixed-point conversion, resource cost text, screen projection, minimap math, and action slot data.

UI / Entity

Get an entity’s display name from its Identity Data.

static FText SeinGetEntityDisplayName(const UObject* WorldContextObject, FSeinEntityHandle Handle);

Get an entity’s icon texture from its Identity Data.

static UTexture2D* SeinGetEntityIcon(const UObject* WorldContextObject, FSeinEntityHandle Handle);

Get an entity’s portrait texture from its Identity Data.

static UTexture2D* SeinGetEntityPortrait(const UObject* WorldContextObject, FSeinEntityHandle Handle);

Get an entity’s identity tag (from its Identity Data).

static FGameplayTag SeinGetEntityIdentityTag(const UObject* WorldContextObject, FSeinEntityHandle Handle);

How a player sees an entity: friendly, enemy or neutral.

static ESeinRelation SeinGetEntityRelation(const UObject* WorldContextObject, FSeinEntityHandle Handle, FSeinPlayerID PlayerID);

UI / Math

Convert a FFixedPoint value to float for display.

static float SeinFixedToFloat(FFixedPoint Value);

Convert a FFixedVector to FVector for display.

static FVector SeinFixedVectorToVector(const FFixedVector& Value);

UI / Format

Turns a resource cost map into text such as 100 Manpower, 50 Fuel, using each resource tag’s last name and rounding amounts. An empty cost reads Free.

static FText SeinFormatResourceCost(const TMap<FGameplayTag, float>& Cost);

UI / Projection

Project a world position to screen coordinates.

static bool SeinWorldToScreen(const UObject* WorldContextObject, APlayerController* PlayerController, FVector WorldPos, FVector2D& OutScreenPos);

Project a screen position to world space (ray-plane intersection at GroundZ).

static bool SeinScreenToWorld(const UObject* WorldContextObject, APlayerController* PlayerController, FVector2D ScreenPos, float GroundZ, FVector& OutWorldPos);

Gets the screen position above an entity’s actor, raised by the given world offset in centimetres. Returns false if the entity has no actor or the point is behind the camera.

static bool SeinProjectEntityToScreen(const UObject* WorldContextObject, APlayerController* PlayerController, FSeinEntityHandle Handle, float VerticalWorldOffset, FVector2D& OutScreenPos);

True if the entity’s actor is on screen, allowing the margin in pixels around the edges.

Defaults: ScreenMargin = 0.0f.

static bool SeinIsEntityOnScreen(const UObject* WorldContextObject, APlayerController* PlayerController, FSeinEntityHandle Handle, float ScreenMargin = 0.0f);

UI / Minimap

Map a world XY position to minimap UV coordinates (0-1).

static FVector2D SeinWorldToMinimap(FVector WorldPos, FVector2D WorldBoundsMin, FVector2D WorldBoundsMax);

Map minimap UV coordinates (0-1) back to world XY position.

Defaults: GroundZ = 0.0f.

static FVector SeinMinimapToWorld(FVector2D MinimapUV, FVector2D WorldBoundsMin, FVector2D WorldBoundsMax, float GroundZ = 0.0f);

Finds where the camera’s four screen corners land on the ground, in minimap UV coordinates (top-left, top-right, bottom-right, bottom-left). Returns fewer than four points if a corner does not hit the ground, for example near the horizon. A Sein camera uses its live ground height; other pawns use Ground Z.

Defaults: GroundZ = 0.0f.

static TArray<FVector2D> SeinGetCameraFrustumCorners(APlayerController* PlayerController, FVector2D WorldBoundsMin, FVector2D WorldBoundsMax, float GroundZ = 0.0f);

The minimap background for the current level: the override texture set on the level volume if there is one, otherwise the top-down texture baked with the level data. None if neither exists.

static UTexture2D* SeinGetMinimapTextureForLevel(const UObject* WorldContextObject);

The minimap’s display rotation in degrees. When bRotateWithCamera is true this is -cameraYaw + RotationOffsetDeg (so the camera’s forward points “up”, the map rotating under a fixed arrow); otherwise just RotationOffsetDeg. Apply this as the render-transform angle on the panel that holds the minimap visuals, AND pass it to Minimap Local To World so clicks un-rotate consistently. One source of truth for the rotation.

Defaults: RotationOffsetDeg = 0.0f.

static float SeinGetMinimapRotationDegrees(APlayerController* PlayerController, bool bRotateWithCamera, float RotationOffsetDeg = 0.0f);

Convert a minimap click (widget-local pixel position on the UN-rotated minimap area) to a world point. Inverts MapRotationDeg, maps to north-up UV, clips to the shape, and projects onto the ground plane at GroundZ.

static bool SeinMinimapLocalToWorld(FVector2D LocalPos, FVector2D WidgetSize, FVector2D WorldBoundsMin, FVector2D WorldBoundsMax, float GroundZ, float MapRotationDeg, bool bCircleClip, FVector& OutWorld);

Draw the camera’s true ground-plane view footprint (a trapezoid — it widens/shrinks faithfully with camera tilt, since it’s the deprojection of the four screen corners onto the ground) into a render target, in NORTH-UP minimap space. Show the render target on an Image inside the SAME rotated panel as the rest of the minimap visuals, so it ends up upright and aligned with the blips. Call this each frame from the minimap widget’s tick — only a widget that actually shows a minimap pays for it. Clears the target each call. No-op if fewer than 4 corners hit the ground (camera at the horizon).

Defaults: LineThickness = 2.0f.

static void SeinDrawCameraViewportToRenderTarget(const UObject* WorldContextObject, APlayerController* PlayerController, UTextureRenderTarget2D* RenderTarget, FVector2D WorldBoundsMin, FVector2D WorldBoundsMax, float GroundZ, FLinearColor LineColor, float LineThickness = 2.0f);

Set an Image widget’s brush resource to any texture-like UObject. Works for a UTexture2D (background / fog) AND a UTextureRenderTarget2D (the viewport-box RT) — the stock “Set Brush from Texture” node only accepts Texture2D and rejects render targets. Preserves the Image’s other brush settings (tint, draw-as, size).

static void SeinSetImageBrushResource(UImage* Image, UObject* ResourceObject);

UI / Action

Builds the action slot data for one ability on an entity. State is Active, On Cooldown or Available; Empty if the entity or ability is missing. Disabled and Unaffordable are never set here, so apply them yourself from the ability info. Tooltip and Hotkey Label are left empty.

static FSeinActionSlotData SeinBuildAbilitySlotData(const UObject* WorldContextObject, FSeinEntityHandle Entity, FGameplayTag AbilityTag, int32 SlotIndex);

Builds action slot data for every non-passive ability on an entity, numbered from 0 in order.

static TArray<FSeinActionSlotData> SeinBuildAllAbilitySlotData(const UObject* WorldContextObject, FSeinEntityHandle Entity);