The recipes in this chapter so far have shown you how to create UIs using the existing primitive widgets.
Sometimes, it is convenient for developers to use composition to collect a number of UI elements together, for example, to define a button class that automatically has a TextBlock
as a label rather than manually specifying the hierarchy every time they are declared.
Furthermore, if you are manually specifying the hierarchy in C++, rather than declaring a compound object consisting of subwidgets, you won't be able to instantiate those widgets as a group using UMG.
This recipe shows you how to create a compound SWidget
that contains a group of widgets and exposes new properties to control elements of those subwidgets. It will also show you how to create a UWidget
wrapper, which will expose the new compound SWidget
class to UMG for use by designers.