Ends Today: Save up to 95% on the Time Travel Mega Bundle!

2D Widget Spacer Plugin For Actors and Items - Prevents Overlap

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

Technical Details

  • Features:
  • Spacing widgets from each other to prevent them from overlapping (main feature of the plug-in) 
  • Force widgets to remain within the bounds of a rectangle (Overlay) - can be disabled
  • Automatically placing 2D widgets over a 3D actor in game (Bound Actor mode)
  • Blueprints events to change widget appearance depending on whether the bound actor is within sight and on which direction he is from player's camera focus (Bound Actor mode)

Code Modules:

  •  WidgetSpacer (Runtime)


Number of Blueprints: 0

Number of C++ Classes: 6

Network Replicated: No

Supported Development Platforms: Windows 32-bit, Windows 64-bit, Linux, MacOS, iOS, Android

Supported Target Build Platforms: Android, Gear VR, HoloLens 2, HTML5, iOS, Linux, MacOS, Nintendo Switch, Oculus, PlayStation 4, Steam VR, Windows 32-bit, Windows 64-bit, Xbox One

Documentation: https://nuage.liiib.re/s/N5X5TF75yZbNCjM

Example Project: https://nuage.liiib.re/s/9wHaHAkJGW5KQzC


GS
GB Studio
All Assets by Author
43.98 
Platforms Other, Windows 64-bit, Windows 32-bit, Oculus, MacOS, Android, HoloLens 2, iOS, Linux
UE Versions 4.27, 5.0 - 5.1
Tags OVERLAP, WIDGETS, STRATEGY, POSITIONNING, UMG, OVERLAYS, HUD, LOOT, RPG, WIDGET, UI ICONS, CODE PLUGIN, UTILITY, ITEMS, USER INTERFACE
Release date 07.10.2022

Similar products

Image
Sign In
Image
Sign Up
Image
Recovery