How to show(or hide) the UMG on the specific screen(viewport) with nDisplay?

Hi s2233125!

I just figured out how! I have 4 displays and was able to add 2 different UMG widgets each to a different viewport. I’ve attached a screenshot of the function. I used the “Displaycluster Module API” node to “Get local viewports” and “Get viewport rectangle” in order to scale all the viewports i did not want the widget to display. I hid the widgets by scaling their “Viewport Size” to 0.

Inside the Function:

  1. First check if the widget exists (isValid) and if not create the widget.
  2. Get all N Display viewport IDs and for each check their IDs to match the ID you wish to assign that specific widget. If it doesn’t match, set the scale to 0.
  3. On completion of the loop, add to viewport.

328905-ndisplay-umg-2.png

At Begin Play (or wherever you need it):
I duplicated the above function for every unique widget (and changed widget + variables inside) then entered the Viewport ID that I wanted for each widget.

Note: I got some memory errors when testing, so this may be memory intensive. But it works. :slight_smile:

3 Likes