Sein World Widget Pool
Class · USeinWorldWidgetPool : UObject
#include "Utility/SeinWorldWidgetPool.h"
Reuses widgets for per-entity screen-space UI such as unit banners. Initialize it with a panel and a widget class, then each tick call Release All and Acquire for every entity that is visible, and position each returned widget yourself. Acquired widgets are not given an entity context; if they are Sein Entity Widgets, call Set Entity Context on them.
Functions
Section titled “Functions”Initialize
Section titled “Initialize”Initialize the pool.
Defaults: InitialPoolSize = 20.
void Initialize(UPanelWidget* InParent, TSubclassOf<UUserWidget> InWidgetClass, int32 InitialPoolSize = 20);Acquire
Section titled “Acquire”Gets the widget for an entity, reusing its current one if it has one, otherwise taking one from the pool or creating a new one, and makes it visible without taking mouse input. Returns none for an invalid entity or before the pool has a parent panel and widget class.
UUserWidget* Acquire(FSeinEntityHandle Entity);Release
Section titled “Release”Hides the entity’s widget and returns it to the pool.
void Release(FSeinEntityHandle Entity);Release All
Section titled “Release All”Release all active widgets back to the pool.
void ReleaseAll();Get Active Widget
Section titled “Get Active Widget”Get the active widget for an entity. Returns nullptr if not active.
UUserWidget* GetActiveWidget(FSeinEntityHandle Entity) const;Get Active Count
Section titled “Get Active Count”Get the number of currently active widgets.
int32 GetActiveCount() const;Get Total Count
Section titled “Get Total Count”Get the total pool size (active + inactive).
int32 GetTotalCount() const;