代码路径
Runtime\UMG\Public\Components\RichTextBlockDecorator.h
该文件有两个类
URichTextBlockDecorator
UCLASS(Abstract, Blueprintable)
class UMG_API URichTextBlockDecorator : public UObject
{
GENERATED_BODY()
public:
URichTextBlockDecorator(const FObjectInitializer& ObjectInitializer);
virtual TSharedPtr<ITextDecorator> CreateDecorator(URichTextBlock* InOwner);
};
-
蓝图文件继承于此类,可用于配置RichTextBlock组件的DecoratorClasses字段。
-
CreateDecorator函数用于构造FRichTextDecorator类对象
ITextDecorator接口
class SLATE_API ITextDecorator
{
public:
virtual ~ITextDecorator() {}
virtual bool Supports( const FTextRunParseResults& RunInfo, const FString& Text ) const = 0;
virtual TSharedRef< ISlateRun > Create(const TSharedRef<class FTextLayout>& TextLayout, const FTextRunParseResults& RunInfo, con