# \[UMG\] How do I create a non editable multiline text block?

**URL:** <https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859>\
**Category:** UI\
**Tags:** editable, container, text, unreal-engine, editor, question, UMG\
**Created:** [August 24, 2014, 6:43am UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859 "2014-08-24T06:43:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![TommyBear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TommyBear](https://forums.unrealengine.com/u/TommyBear)\
**Post date:** [August 24, 2014, 6:43am UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/1 "2014-08-24T06:43:53Z")

</div>

Hi Guys,

I’m trying to create a dialog that contains text. The dialog may contain more or less text depending on the situation. Therefore I need a text block which is multiline(not editable). Is that currently possible with UMG?

Like this:

![13574-screen+shot+2014-08-24+at+4.46.35+pm.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/f/7ff1e36b849fb417d1b642eedd6b56f1a222a0f2.png)

or

 ![13575-screen+shot+2014-08-24+at+4.54.01+pm.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/d/90d839a3e0d71668b4f375cdf592d4c66a57a9f7.png)

EDIT: Is it possible to have a border element size itself to fit the content, but still be centered vertically and horizontally?

Tommy.

---

<div class="post-metadata">

**Author:** ![NickDarnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NickDarnell](https://forums.unrealengine.com/u/NickDarnell)\
**Post date:** [August 24, 2014, 1:11pm UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/2 "2014-08-24T13:11:08Z")

</div>

Hi TommyBear, yes that’s possible now. Except for the centering on multiple lines. The centering is done based on the size of the whole textblock. So it wont center individual lines. Sizing for elements is decided by their parent. So the text has a desired size, but the border would tell the text how much room it gets. Same goes for the border element, the border can only auto size if the container it is in permits it. So if it’s inside a canvas the canvas tells the border how big it can be, even if it wants to take up more room. So you’d need to use a flow layout panel, like placing the border inside a Vertical or Horizontal box, which will allow the border to take the room it needs but automatically align it based on the alignment rules you’ve set.

---

<div class="post-metadata">

**Author:** ![TommyBear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TommyBear](https://forums.unrealengine.com/u/TommyBear)\
**Post date:** [August 24, 2014, 1:24pm UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/3 "2014-08-24T13:24:36Z")

</div>

Hey Nick! Thanks for the answer. So just to clarify (because I’m not in front of Unreal right now), I can achieve the following(using the method you describe):

- Line by line centering is not supported in the text block
- I can achieve a multi-line output in a textblock
- I can pump a string into this text block and have a border resize to fit the text block?
- The parent textblock can then be centered vertically and horizontally?

I’m not seeing multiple lines in the textblock. It is not wrapping. Thanks heaps for the answers!

EDIT: Yeah the main issues here for me are basically:

- The textblock does not support multi-line
- I need the border around the text to resize to fit the text

Tommy.

---

<div class="post-metadata">

**Author:** ![NickDarnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NickDarnell](https://forums.unrealengine.com/u/NickDarnell)\
**Post date:** [August 24, 2014, 2:20pm UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/4 "2014-08-24T14:20:15Z")

</div>

Yup your summary is the gist of it. By default the textblock wont wrap, you need to enable autowrap text on it. You can also pick a specific width to begin wrapping at.

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [August 24, 2014, 9:36pm UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/5 "2014-08-24T21:36:03Z")

</div>

The wrapping for text-blocks is also a little iffy if you have new-line characters in your source text.

I’m working on a solution for that, and I’m also hoping to add proper justification support (to allow centering the text on a line-by-line basis).

---

<div class="post-metadata">

**Author:** ![TommyBear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TommyBear](https://forums.unrealengine.com/u/TommyBear)\
**Post date:** [August 25, 2014, 12:57am UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/6 "2014-08-25T00:57:39Z")

</div>

That is just awesome Jamie!! Thank you so much. Just quickly. To get the dialog automatically recentering as it resizes, should I be putting it in a vertical/horzontal panel and then centering the parent?

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [August 25, 2014, 1:19pm UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/7 "2014-08-25T13:19:37Z")

</div>

It’s the HAlign and VAlign of the parent slot that affects the children of that slot.

I’m not 100% sure how this translates into UMG terminology, but you’d set the parent slot of the text block to be centered, which I think is what you said.

If you do need proper center justification of your text, the rich-text block _does_ support justification, although it’s a bit more heavy weight and perhaps not as flexible. Hopefully this situation will improve for 4.5 though.

---

<div class="post-metadata">

**Author:** ![tomofnz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomofnz](https://forums.unrealengine.com/u/tomofnz)\
**Post date:** [December 2, 2015, 8:11am UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/8 "2015-12-02T08:11:49Z")

</div>

the trick is not just ticking Auto Wrap Text but also setting, below it, Wrap Text At value ( which is in pixel space not number of characters )

---

<div class="post-metadata">

**Author:** ![tomofnz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomofnz](https://forums.unrealengine.com/u/tomofnz)\
**Post date:** [December 2, 2015, 8:12am UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/9 "2015-12-02T08:12:02Z")

</div>

the trick is not just ticking Auto Wrap Text but also setting, below it, Wrap Text At value ( which is in pixel space not number of characters )

easy to miss it

---

<div class="post-metadata">

**Author:** ![Hunxenlunx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hunxenlunx](https://forums.unrealengine.com/u/Hunxenlunx)\
**Post date:** [April 8, 2017, 7:23am UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/10 "2017-04-08T07:23:40Z")

</div>

I want to kiss you for this! You solved a huge headache for me!

---

<div class="post-metadata">

**Author:** ![Iroidhdr17](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iroidhdr17/32/567233_2.png) [@Iroidhdr17](https://forums.unrealengine.com/u/Iroidhdr17)\
**Post date:** [August 29, 2022, 12:18pm UTC](https://forums.unrealengine.com/t/umg-how-do-i-create-a-non-editable-multiline-text-block/291859/11 "2022-08-29T12:18:49Z")

</div>

Use normal Text and If you want to enter text in multiline then use SHIFT+ENTER to go to the second line. Hope it helps
