Instead, you can extend it as a C++ class. The RichTextBlockImageDecorator class doesn't appear on the list of parent classes. Open your new Blueprint, and assign your Data Table to the Image Set property. One way to do that is to follow these steps.Ĭreate a new Blueprint class, and choose RichTextBlockImageDecorator as the parent class. To create and use your own decorator classes, you need to extend the example RichTextBlockImageDecorator class, and then point your subclass at the Data Table Asset. To create a Data Table Asset that references your own decorator classes, refer to the Creating and Assigning a Data Table Asset section above. To help you get started using your own Decorator Classes, we've included a built-in example with RichTextBlockImageDecorator, which enables you to add inline images to text when using a Rich Text Block. When you create a Decorator Class, you can set up your own markup tags that allow you to use Slate to render other elements seamlessly within your text. If you want to include something other than styled text in your Rich Text Block, you can create Decorator Classes. When referencing a Data Table Asset Row Name in your Rich Text Block, the row name is not case sensitive. To apply a different style to your text, type the name of the style row in enclosed brackets, using the format Text. For example, if we typed "This is some rich text!" it would display using only our default Appearance values referenced by the Data Table Asset. You will see the text display in the styles you chose for the Default row in the Data Table Asset. Type your text into the Text field of the Rich Text Block. Locate the Content section on the Details panel. Once you've assigned the Data Table Asset to the Rich Text Block Widget, you'll want to apply styles to the text. In this example, we use the Rich Image Row decorator class that has been provided in order to create inline images with the rich text. Use Decorator Classes to apply any custom decorator classes you've created for your project. Any styles you created in your Data Table Asset can be referenced using the Row Name you gave it. Use the Text Style Set to apply your Rich Text Style Rows. Once you've added the Rich Text Block widget to the graph, select it and use the Details panel on the right to apply your Rich Text Style Row or Rich Image Row data types in the Appearance section. Assign a Data Table Asset to a Rich Text Block If you do not resize the box to fit your text size, some of your text may be clipped and not display properly. The text box does not scale automatically to fit the text size. The Data Table Asset can specify text styles, or it can specify images that you can use in-line with Rich Text. With this Data Table Asset, you can create different types of data tags that you can use with Rich Text Blocks in UMG. Follow the steps below to learn more about the RichTextBlock in UMG, and how you can write your own decorator classes.īefore you can apply styles to a Rich Text Block Widget, you'll need to create a Data Table Asset. We've included an example decorator class, RichTextBlockImageDecorator, which you can use as a starting point for writing your own decorator classes. With the Data Table Asset, you can create your own styles, or write your own decorator classes that define the markup behavior you need for your project. The RichTextBlock uses a Data Table Asset to manage added styles and customization. While the Text Block provided in Unreal Motion Graphics (UMG) offers a variety of style options and customization, you might need a more flexible text block option that supports markup for things like style changes, inline images, and hyperlinks. Using Rich Text Block Widgets in UMG UI DesignerĪssign a Data Table Asset to a Rich Text Block Remove Style or Image Rows in the Data Table Asset Creating and Assigning a Data Table AssetĪdd Style or Image Rows in the Data Table Asset
0 Comments
Leave a Reply. |