Custom Rich Text Block Image Decorator


Version: 4.26.1
C++ and Blueprint


I found that when using a Rich Text Block Image Decorator, the images
would sometimes not have the desired Y positioning in the text.
For this it is quite simple to use a class that derives from
URichTextBlockImageDecorator where we can pass a transform as
meta data of the img-tag.
I wrote a class which also is capable of width, height and margin overrides.

Custom Rich Text Block Image Decorator In Blueprint

Another thing is functionality to for example draw item icons by some sort of
type and/or unit index.
For this we can modify URichTextBlockImageDecorator in a way that it will load
a texture based on the item meta data we pass through.
The example class I wrote looks for an itemimg-tag instead of an img-tag and
for itemtype and itemunit meta data.

This is a class for item type images for my game:

Item Rich Text Block Image Decorator in Blueprint

Download:

CustomRichTextBlockImageDecorator.zip

Installation:

Put the files from the .zip archive in Source/[YOURGAME] of your project.
Change includes if needed and change "YOURGAME_API" to be the API of your project.
You might also want to add "UMG" to the PublicDependencyModuleNames and uncomment
the Slate section in the Build.cs file of your project.