# How to make text in an overlay extend from right to left?

**URL:** <https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808>\
**Category:** UI\
**Tags:** overlay, unreal-engine, question, UMG\
**Created:** [August 15, 2020, 2:41pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808 "2020-08-15T14:41:27Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 15, 2020, 2:41pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/1 "2020-08-15T14:41:27Z")

</div>

I have an overlay with a text block, image, and button that all size to the length of the text, but I want them to extend from right to left, so the text is justified on the right. No matter what justification, alignment, or flow settings I use, it doesn’t change. It always extends from left to right. Does anyone know how to do this?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Blackforcedragon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackforcedragon/32/1010299_2.png) [@Blackforcedragon](https://forums.unrealengine.com/u/Blackforcedragon)\
**Post date:** [August 15, 2020, 3:12pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/2 "2020-08-15T15:12:01Z")

</div>

![310249-0039.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/d/e9d37be6508a3cec8e6942a9662ff35188613704.png)

---

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 15, 2020, 5:12pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/3 "2020-08-15T17:12:56Z")

</div>

No, that’s just a text block inside of a canvas. I need a text block justified to the right that is a child of an overlay widget inside of a canvas.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 15, 2020, 7:53pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/4 "2020-08-15T19:53:52Z")

</div>

> I need a text block justified to the  
> right that is a child of an overlay  
> widget inside of a canvas.

That’s what slots are for:

 ![310275-annotation-2020-08-15-205515.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/5/d95c2ac483fbe584a0834b02329e9dfebb274dbb.jpeg)

---

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 15, 2020, 8:50pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/5 "2020-08-15T20:50:17Z")

</div>

But then how do I make the image and button always stay the same size as the text?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 15, 2020, 9:28pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/6 "2020-08-15T21:28:30Z")

</div>

You’re probably after a double overlay:

 ![310302-annotation-2020-08-15-222221.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/2/be2b3ceb254021f75719d4757d9bb3f131259737.jpeg)

The outer overlay is flagged as _Size To Content_, this desired size is provided by the inner overlay being stretched by the text box. The image and button are set to Fill and simply conform.

This will not work too well if the image is larger than the text. Hopefully that’s not an issue, do tell if it is.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 15, 2020, 9:37pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/7 "2020-08-15T21:37:57Z")

</div>

Not sure if I follow what you’re trying to achieve, though. If the above does not help much, consider dropping a mock of of the end result.

---

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 15, 2020, 11:11pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/8 "2020-08-15T23:11:31Z")

</div>

I have an outer overlay with size to content set, an inner overlay with alignment settings to the right, an image and button set to fill, and a text block set to align and justify to the right, and it still hasn’t changed anything

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 16, 2020, 7:03am UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/9 "2020-08-16T07:03:32Z")

</div>

Show us what you expect from the end result. My setup followed your description but it seems it is not what you need.

You’ll need to clarify some more.

---

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 16, 2020, 2:53pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/10 "2020-08-16T14:53:11Z")

</div>

So my text is a variable that’s bound to C++. I want it to be on the right side of the canvas, and extend from right to left, so the right border never changes. I also want to have a button and image underneath the text block that size to the same size as the text.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 16, 2020, 2:56pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/11 "2020-08-16T14:56:41Z")

</div>

That’s _exactly_ what I have above, no? Even a single overlay anchored to the right would work here. I though you were after something more complex.

Can you confirm the effect you see in my image is the end result you’re after?

---

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 16, 2020, 3:40pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/12 "2020-08-16T15:40:29Z")

</div>

If when you continue typing into those text blocks, it moves the text left, then yes. But it didn’t work for me. What exactly did you set each widget as?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 16, 2020, 3:55pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/13 "2020-08-16T15:55:52Z")

</div>

You can ctrl+shift+click this to set the anchors and alignment automatically for the overlay that sits in the canvas.

Image & Button H/V alignement are set to _Fill_ to they conform to whatever the text size there is.

 ![310358-annotation-2020-08-16-164852.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/b/1/cb1330e3dd45bfe926031fef27413b20bd7b3ecb.jpeg)

 ![310359-text.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/e/b6e44ebb6813a54c6b1b9a01d7c5e253eaa04fcb.jpeg)

No need to worry about the text itself, _Size to Content_ of the canvas’s slot will take care of everything anyway.

* * *

But again, if the button or the image are larger than the text (because this can be overridden), then they will start dictating the size of the overlay.

---

<div class="post-metadata">

**Author:** ![Samathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/samathan/32/1058905_2.png) [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Post date:** [August 16, 2020, 4:11pm UTC](https://forums.unrealengine.com/t/how-to-make-text-in-an-overlay-extend-from-right-to-left/469808/14 "2020-08-16T16:11:55Z")

</div>

It finally works, thank you!
