FAQ: UI and UX

FAQ includes content originally written for UDN.


If using both server travel and client travel, what are the right places in the code to add Show() and Hide() calls?

  • This will vary depending on your game’s flow, but binding to FCoreUObjectDelegates::PreLoadMap and FCoreUObjectDelegates::PostLoadMapWithWorld is a good place to start.

Could you explain more about using external modules for loading screens? What is the difference between this and using UMG?

  • Using a separate module for loading screens decouples the functionality from your game module(s) and enables you to reuse the code in other projects. The ARPG example runs the loading screen on the slate thread instead of UMG, so it’s smooth and unaffected by the level loading happening on the game thread.

What is the recommended method to efficiently style the UI?

  • With UMG you make blueprints of widgets that are reused everywhere so if you need to change the style of a button, you just make a blueprint of the button and just update the blueprint which will propagate the changes to all live instances. You can also make style assets shared between widgets and update those assets instead of the widgets directly.
  • We have an internal system built on top of UMG called CommonUI which makes this a lot easier. We’re planning to release this to licensees in the future.

Are there any solutions for Discord or Twitch integration?

  • We don’t have any out-of-the-box solutions for Discord or Twitch integration. Our media framework supports playback of some streaming formats, so it may be possible to embed a Twitch stream that way.

Web Widget. Is this ever going to be fully implemented?

  • It’s unlikely that it will ever be considered “complete”, as there are many CEF features that aren’t supported or come with large performance costs that we want people to be wary of.

Are there optimizations that are coming down the road?

  • We’ve recently been experimenting with an invalidation-based mode for Slate that has given some significant performance gains. Those changes are available now in beta via the Slate.EnableGlobalInvalidation console variable, and we’re ironing out bugs as we encounter them.

A release update recently cited tools in the editor that could be created with UMG. What is the intended use case for that?

  • Editor Utility Widgets were conceived as an upgrade/replacement for Blutilities, which empowers our designers and technical artists to quickly create tools in the editor without needing a programmer to code it for them. We don’t plan to use it for any editor functionality that we ship for performance reasons, but we’ve used it on game projects to quickly create tools for tasks like generating minimaps or finding and replacing deprecated data

We had to implement a loading spinner in native code so that it wouldn’t hitch. Is there any way for UMG to display something that will not hitch?

  • Plenty of things don’t hitch, but if you do something in UMG that forces a sync load, that’s going to hitch - same as any other asset. There’s nothing intrinsic about UMG that’s any different than native, save for the fact that it’s backed up by UObjects for blueprint integration and the ability to easily reference assets and have those cooked correctly.

What is Epic’s thought on using materials in UMG?

  • Using materials is the best approach

We are planning on using Rich Text as our default rather than try to juggle between two different types of text boxes. Are there performance concerns?

  • Rich Text Blocks are heavier weight than the traditional UMG text blocks. If performance isn’t a concern in the cases where you’re using them, it should be fine. However, you may run into problems in places where performance is important, especially in text that updates often. You may need to do some profiling to see what works best for you.

What is the benefit of UserWidget templates?

  • Under the old approach (duplicating each thing via serialization), widget creation costs could be extremely costly in CPU time. By building up a completed tree with everything fleshed out, UE4 can use that as an archetype in UObject creation so that it works like a CDO.
  • To reduce the memory, in the blueprint properties you can set up the widget to not generate a template by default, we do that for several that are never themselves directly created, but are always included inside of other widgets that we create. E.g. if A is your inventory and B and C are widgets that are always just placed inside of A in the designer, you can disable template creation for B and C, and at Editor time we log an error if you do try to create B or C directly.

Ways to get HTML into UE4?

  • You can try loading your UI through a web view. There’s also an HTML menus plugin. It might be easier to rebuild into UMG than to try to get it in your project.


Python support for Slate?

  • We have no plans to support python directly creating Slate UI.
  • Editor Utility Widgets (UMG and BPs) are the path forward there and users can add their own hooks to call back into python as necessary (via blueprint callable functions)

What are the best practices for the variety of resolutions/aspect ratios of android devices, with regards to UI and touch controls (anchoring and scaling)?

  • As of 4.25, we have a couple of different resolutions
    • Mobile content scale factors - on Android, 1.0 is 720p, 2.0 is full HD, and this is the size of the backbuffer and resolution of the UI
    • We have dynamic resolution working for iOS on 4.25 and on
    • This makes sure the 3D scene changes resolution, but the 2D should stay consistent
    • We only make changes for iPads, with bigger resolutions and backbuffers to make the image sharper

See more about UI/UX on the Knowledge Base.