I am working learning Slate for doing the UI. I am having a problem setting a background image. The background is all black and I do not see the image anywhere. What am I doing wrong? I have done searching the internet and the engine code and this seems to be how things should be done but I must be missing something.
Here is my code:
TSharedPtr<FSlateStyleSet> Style = MakeShareable(new FSlateStyleSet("ZombieHorde"));
Style->SetContentRoot(FPaths::ProjectContentDir());
Style->Set(
FName("test"),
new FSlateImageBrush(Style->RootToContentDir(TEXT("test"), TEXT(".png")),
FVector2D(300.0, 300.0),
FLinearColor(0,0,0,1))
);
ChildSlot
[
SNew(SOverlay) + SOverlay::Slot()
.VAlign(VAlign_Fill)
.HAlign(HAlign_Fill)
[
SNew(SImage)
.Image(Style->GetBrush(FName("test")))
]
....