Currently, inline images in a Rich Text Block will scale but only as large as the current font size. So I try to change the font size where the image is (in order to get the image larger), but you can’t wrap <img id=“id”/> with another style, because the image doesn’t get picked up. I also tried using a size box to override the height for the rich text block but it remains small.
As a workaround, currently I set the “Default” rich text style to the size that I want my inline images, and then apply a different (smaller) font style to the text either side of the image. It’s ok because most of my inline images are the same size. But it would be great if you could just use your default style for your text, then adjust your image size separately.
If we could go:
This is some default style text<ImgSize><img id="id"/></> and this is some more text
Then we could use styles to set maximum sizes for an inline image.
edit: actually nesting styles in general would be great. sounds hard though…
Hey, for anyone looking for this in the future, I accidentally discovered that we could enlarge the inline image by specifying the width and height for the img element.
For example: Some text <img id="ImageID" height="64"/> more text. This will increase the inline image height to 64 pixels (or whatever unit the UMG uses), i.e. enlarge it.
The width and height parameters are not mentioned in the documentation at all so I found out just by purely guessing after seeing @axelkomair01’s reply.
P/S: I’m using Unreal Engine 5.1 on Linux (Kubuntu 22.04)
The `width` and `height` parameters are not mentioned in the [documentation ](https://docs.unrealengine.com/5.0/en-US/umg-rich-text-blocks-in-unreal-engine/#decoratorclasses) at all so I found out just by purely guessing after seeing @axelkomair01’s reply.
@ congthuan This is insane, and you are a lifesaver. Have you found any more of these parameters since?
There’s a few more of these parameters for the img. You can look at the source code here (Note: Access permission to the Unreal Engine source code is needed to access this link).
Just for easy googling later. As of now here’s what the source code has:
/**
* Add an image inline with the text.
* Usage: Before image <img id="MyId"/>, after image.
*
* A width and height can be specified.
* By default the width and the height is the same size as the font height.
* Use "desired" to use the same size as the image brush.
* Usage: Before image <img id="MyId" height="40" width="desired"/>, after image.
*
* A stretch type can be specified. See EStretch.
* By default the stretch type is ScaleToFit.
* Usage: Before image <img id="MyId" stretch="ScaleToFitY"/>, after image.
*/
class FRichInlineImage : public FRichTextDecorator