I spent the better part of yesterday trying to figure out how to load resources (like textures) into the Slate UI. I finally figured out it with a bit of help from one very talented member of the community, Jamie Dale.
An example of what you will be able to achieve with this is in the screenshot below (it’s only all black because I’m in debug mode and have no baked lights).
@Agentlo, Ineni.RealTime is exactly correct. An example of a “master widget” (for lack of better word) is below. This is some of the code involved int he above screenshot. The rest of it can be found on the AnswerHUB, organizing it is up to you, although my tutorial provides some basic guidance, your design is ultimately your own. Personally I’m following the RTS/FPS code examples pretty close, I think it’s useful to have a code-base familiar with the community in-case I’m ever in the position to do any recruiting.
void SMyUIWidget::Construct(const FArguments& InArgs)
/////Create UI resources
/////Get handle on game resources
const FSlateGameResources &GameResources = FMyUIResources::GetUIResources();
/////Get handle on slate_spell_heal Slate Brush
const FSlateBrush *slate_spell_heal = GameResources.GetBrush(FName("spell_heal"));
OwnerHUD = InArgs._OwnerHUD;
As you can see, the only widget that is my own is SMyUIWidget, which is almost exactly how it is defined in my tutorial. All of it’s child widgets are standard Slate widgets, although they don’t have to be, I’m currently thinking of subclassing SImage to make an SAbility widget that will overload it adding the ability for designers to easily change their properties in the Blueprint Editor (a combination of components and Widgets), they also need to handle mouse/keyboard events (good reason to overload), they also need to be editable real time, such as if the player drags and drops them onto another ability widget, that can be done with a custom event and a FAbilityProperties data struct. In the longer term I’ll probably subclass SHorizontalBox also, and add some functionality there too, but first I need to continue my audit to figure out what all Epic has already done for us.