The Widget Spacer plugin, built entirely in C++, allows you to automatically space any widgets placed on an overlay in your UI and prevents overlap. It is instrumental in situations with many actors like enemies, players, and items, which normally cause the text widgets to overlap and need to be completely legible or clickable. It also includes features allowing it to automatically place these widgets over the 3D position of an actor on screen and on the screen's border with an arrow pointing to its direction when the actor is off-screen.
It's built with efficiency and optimization in mind for situations where even 50+ widgets can exist simultaneously on the screen without much FPS loss.
Typical example of usage:
- RPG games where you want to display 2D messages or icons over NPCs (Bound-Actor mode)
- Top-down games with lots of loot (items) and enemies
- Complex UIs systems where you need to move over some widgets (Manual mode)
- Flight games and simulators where you need to locate objects off-screen
- Strategy games where you need 2D display over your and other player units (Bound-Actor mode)
- Sports game where you need to display 2D UI over game elements
- Displaying widgets on the border of the screen to indicate the direction of an actor that is out of sight (Bound-Actor mode)
- etc.
Plug-in objects:
The plug-in defines the following C++ classes that are usable and blueprintable in your own project :
- SpacerOverlay: Inherits from Overlay widget. This is the main component of the plug-in, it defines the zone within which the spaceable widgets will be placed. It hosts all the computations. It has two modes:
+ Manual : Widgets can be freely placed by the developper (with SetIdealPosition method) and will be spaced from each other when calling SpaceWidgets method.
+ ActorBound : Allows to automatically place the 2D widgets over actors in the 3D game and space them.
- SpaceableWidgetInterface: Interface to be implemented by all individual widgets to be added in the spacer overlay that should be spaced from each other.
- SpaceableWidgetBase: Parent class implementing SpaceableWidgetInterface than you can inherit to simply use the Manual mode.
- BoundActorWidgetBase: Parent class implementing SpaceableWidgetInterface than you can inherit to simply use the BoundActor mode.
- SpacerHelper: Class not made to be instanced, containing a bunch of helpful static methods.
- WidgetSpacer: Plug-in definition class. Not to be used.
Overview video : https://youtu.be/0QQcKhEEyqU