# UMG autowrap makes text flicker upon appearing

**URL:** <https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567>\
**Category:** UI\
**Tags:** flicker, text, unreal-engine, question, UMG\
**Created:** [May 25, 2017, 1:28pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567 "2017-05-25T13:28:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakobR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakobR](https://forums.unrealengine.com/u/JakobR)\
**Post date:** [May 25, 2017, 1:28pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/1 "2017-05-25T13:28:57Z")

</div>

I have an UMG issue where the text flickers a millisecond upon appearing in the game.  
In that millisecond it seems that the text widget does auto wrapping to make the words fit in the text box. One can see that UMG re-arranges the words in textbox that millisecond. This holds even true if the text is a variable.  
My hierarchy is: Border - Canvas Panel - Text (see attachment) .

Is it possible to get rid of this small flicker? It is a small thing which adds up and diminishes the quality experience.

 ![139153-umg_hierarchy_25052017.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/7/d876cf91bfceb3523f4cef677130e21fc68cebcb.jpeg)

---

<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:** [May 25, 2017, 1:36pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/2 "2017-05-25T13:36:59Z")

</div>

Slate layout happens in a single-pass, and the comment for auto-wrapping states that it will have a 1-frame delay.

If you don’t want that artefact then you’ll have to used fixed-width wrapping (note that fixed-width wrapping may still be bound to something that changes its width, it just means that it’s not automatically computed once the desired size is known).

---

<div class="post-metadata">

**Author:** ![JakobR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakobR](https://forums.unrealengine.com/u/JakobR)\
**Post date:** [May 25, 2017, 2:10pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/3 "2017-05-25T14:10:54Z")

</div>

Thanks for the reply. How would I go about doing fixed-width wrapping to get rid of this artefact? Many thanks.

---

<div class="post-metadata">

**Author:** ![JakobR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakobR](https://forums.unrealengine.com/u/JakobR)\
**Post date:** [June 8, 2017, 11:08am UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/4 "2017-06-08T11:08:48Z")

</div>

I’ve now inserted hard line breaks now with SHIFT + Enter . These should generate the fixed-width wrapping. Correct?  
I have tried the result on PC and a Nexus5 and I think the 1 frame auto-wrapping is gone now. Since the auto-wrapping is no longer called into action.

If I store my text in variables - I always need to calculate at what word it should go onto a new line. There must be a more convenient way to do this I hope?

 ![190209-avoidingautowrap_08062017.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/3/8539fa33c24064ce41728064efcfed6fdab654dd.jpeg)

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8190d78f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8190d78f](https://forums.unrealengine.com/u/anonymous_user_8190d78f)\
**Post date:** [June 19, 2017, 4:37pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/5 "2017-06-19T16:37:36Z")

</div>

You can try fixed-width wrapping. Uncheck “Auto Wrap Text” and in the “Wrap Text At” field underneath it, enter the width that you want to wrap at (normally the length of the Text, or a few pixels less).

---

<div class="post-metadata">

**Author:** ![Onyxius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Onyxius](https://forums.unrealengine.com/u/Onyxius)\
**Post date:** [August 8, 2017, 7:52pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/6 "2017-08-08T19:52:20Z")

</div>

I had to reply to say thank you Archduke\_. That fixed it for me, it was driving me crazy.

---

<div class="post-metadata">

**Author:** ![JakobR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakobR](https://forums.unrealengine.com/u/JakobR)\
**Post date:** [October 6, 2018, 1:29pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/7 "2018-10-06T13:29:25Z")

</div>

Yes, indeed! Thanks @Archduke\_

---

<div class="post-metadata">

**Author:** ![ELKatlan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ELKatlan](https://forums.unrealengine.com/u/ELKatlan)\
**Post date:** [August 4, 2021, 8:34pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/8 "2021-08-04T20:34:21Z")

</div>

While this workaround works, this still feels like a bug that AutoWrap has a 1-frame delay. I could see some performance warning when using it and making it not on by default, but saying a 1-frame pop is acceptable (and NOT noted in the tooltip) is definitely something worth fixing.

---

<div class="post-metadata">

**Author:** ![42stCalamity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@42stCalamity](https://forums.unrealengine.com/u/42stCalamity)\
**Post date:** [March 9, 2023, 9:05am UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/9 "2023-03-09T09:05:28Z")

</div>

start the text with opacity 0. after milliseconds, in a delay macro, you change the opacity to 1.

---

<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:** [March 9, 2023, 9:23am UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/10 "2023-03-09T09:23:24Z")

</div>

Hacky. That’s what:

> **[Force Layout Prepass](https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Widget/ForceLayoutPrepass/)**
>
> Force Layout Prepass

is for.

---

<div class="post-metadata">

**Author:** ![Daerst](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daerst/32/266918_2.png) [@Daerst](https://forums.unrealengine.com/u/Daerst)\
**Post date:** [February 16, 2024, 11:53am UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/11 "2024-02-16T11:53:15Z")

</div>

I’ve tried every combination of `ForceLayoutPrepass` I could think of, including calling it multiple times and on different Widgets (the text block, the parent, reverse order, ping pong) - nothings seems to properly update the auto-wrap and get rid of the one-frame delay. This is a consistent issue and very noticeable especially if you play on low FPS (e.g. `t.MaxFPS 20`). Any more hints are appreciated, my workaround for now is to use fixed wrapping wherever possible or set the text visible with a one-frame delay, both of which isn’t too great.

---

<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:** [February 16, 2024, 12:11pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/12 "2024-02-16T12:11:40Z")

</div>

> [@Daerst](#):
>
> Any more hints are appreciated

Could you share the widget hierarchy and set text method to reproduce this issue?

---

<div class="post-metadata">

**Author:** ![Daerst](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daerst/32/266918_2.png) [@Daerst](https://forums.unrealengine.com/u/Daerst)\
**Post date:** [February 16, 2024, 2:00pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/13 "2024-02-16T14:00:39Z")

</div>

My hierarchy for testing is this:  
 ![TestWidget -> CanvasPanel -> SizeBox -> Border -> TextBlock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/8/788a84b28adcc507bee0544a58492ee73a52c0a2.png)

The size box sets a maximum desired width of 400 and size to content, the text is set to auto-wrap.

Here I am trying all sorts of `Force Layout Prepass`, bottom up, back down and back up the hierarchy:

 ![All the Force Layout Prepasses](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/2/002e90283c1fa7ec0b50424f105d0d9dc0ad0923.png)

Still, when I set `t.MaxFPS 2` the result looks like this:  
 ![GIF showing that there still is a frame delay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/f/22f7db420f380f6fc567c7eeab0f80e4689bf5a3.gif)

Workarounds? Fixed wrap width. Hiding and showing with one frame delay. All suboptimal, I keep my fingers crossed someone has a solution for this, as it’s _really_ getting my way in a UI-heavy game I’m working on.

// EDIT: Correction - A Width Override on the size box (instead of Max Desired Width) doesn’t help either.

---

<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:** [February 16, 2024, 2:02pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/14 "2024-02-16T14:02:19Z")

</div>

This should **not** be in `onInitialised` - the widget is not laid out yet, PrePass does nothing here. Does it behave the same when you place it in `EventConstruct`?

---

<div class="post-metadata">

**Author:** ![Daerst](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daerst/32/266918_2.png) [@Daerst](https://forums.unrealengine.com/u/Daerst)\
**Post date:** [February 16, 2024, 2:04pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/15 "2024-02-16T14:04:27Z")

</div>

Good point, sadly the problem persists when I use Construct.

---

<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:** [February 16, 2024, 2:07pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/16 "2024-02-16T14:07:19Z")

</div>

Size Box makes little sense inside a Canvas Slot - setting Desired Size is the slot’s job here. Could you remove the Size Box and punch in the size for the Border directly instead:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/6/2f6b0df581959677212198499cb89a39a27cd43f.png)

RMB the Size Box → Replace with Child should work.

---

<div class="post-metadata">

**Author:** ![Daerst](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daerst/32/266918_2.png) [@Daerst](https://forums.unrealengine.com/u/Daerst)\
**Post date:** [February 16, 2024, 2:11pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/17 "2024-02-16T14:11:26Z")

</div>

If I scrap the size box, I have no way of setting the Desired Width while Sizing To Content in terms of height, do I? Only way I see is to tick off Size To Content on the slot and use a fixed Wrap At on the text, again working around the initial problem, but this becomes anything from cumbersome to impossible in cases where there’s multiple elements, layouts etc. inside the border.

---

<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:** [February 16, 2024, 2:12pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/18 "2024-02-16T14:12:00Z")

</div>

That’s what slot is for:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/c/9ace7fb218ba2c268fe587513f8e08d5c1c9d23c.png)

> I have no way of setting the Desired Width while Sizing To Content in terms of height

This is either contradicting or you have some special requirements for this. You need vertical to conform while overriding horizontal, right?

* * *

Do you see the undesired flicker without the Size Box?

---

<div class="post-metadata">

**Author:** ![Daerst](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/daerst/32/266918_2.png) [@Daerst](https://forums.unrealengine.com/u/Daerst)\
**Post date:** [February 16, 2024, 2:14pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/19 "2024-02-16T14:14:54Z")

</div>

I don’t understand. I can set a width, but I don’t know the height - that height comes from the wrapped text. If I use a slot only, I can either set the size manually (which I can’t because I don’t know the height) or I can set it to Size To Content (and then the slot will happily expand in width forever and the text will never wrap).

---

<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:** [February 16, 2024, 2:15pm UTC](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567/20 "2024-02-16T14:15:58Z")

</div>

> [@Daerst](#):
>
> I don’t understand.

Nah, it was me who was not getting the **full** picture, basically.

[Next page](https://forums.unrealengine.com/t/umg-autowrap-makes-text-flicker-upon-appearing/394567.md?page=2)
