Hello,
I’m writing the full UI of a game purely in Slate, but now I’m stuck, because I can’t get the SRichTextBlock to work with image Decorators, I just can’t figure out the workflow to create/get the image decorators with slate. Any advice(?)
thank you~
PS.:
The Rich Text Block Styles were no problem, solved like this:
StyleInstance = MakeShareable(new FSlateStyleSet(TEXT("RichTextStyle")));
for (const TPair<FName, uint8*>& Entry : GlobalStyle->RichTextStyleSet->GetRowMap())
{
FName SubStyleName = Entry.Key;
FRichTextStyleRow* RichTextStyle = reinterpret_cast<FRichTextStyleRow*>(Entry.Value);
if (SubStyleName == FName(TEXT("Default")))
{
DefaultTextStyle = &RichTextStyle->TextStyle;
}
StyleInstance->Set(SubStyleName, RichTextStyle->TextStyle);
}
TSharedRef Marshaller{ FRichTextLayoutMarshaller::Create(CreatedDecorators, StyleInstance.Get()) };
SNew(SRichTextBlock)
.Text(FText::FromString("<Default>Test</><Test>Smaller</><img id=\"Logo\"></>"))
.TextStyle(DefaultTextStyle)
.Marshaller(Marshaller)