Anyone knows how to control this text pushing other text issue (see screens)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dgames
Posts: 22
Joined: Wed Mar 13, 2024 10:44 am

Anyone knows how to control this text pushing other text issue (see screens)

Post by dgames »

Please check the screens bellow, it shows the NPC line with few words and then with a lot of words. when the words need two or more lines it pushes the name to the side and stretches that text. I have no idea why it does this and how to fix it. I really need some help here thanks :) the Ui is "Basic Standard Dialogue UI TMPro"
dialogue A.png
dialogue A.png (17.7 KiB) Viewed 72 times
dialogue B.png
dialogue B.png (48.44 KiB) Viewed 72 times
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Anyone knows how to control this text pushing other text issue (see screens)

Post by Tony Li »

Hi,

You can add a Layout Element component to the subtitle panel's Portrait Name GameObject if one doesn't already exist. Tick Min Width and set a width such as 200 pixels:

portaitNameMinWidth.png
portaitNameMinWidth.png (126.3 KiB) Viewed 65 times

Then the portrait name will always be at least 200 pixels instead of getting squished.
dgames
Posts: 22
Joined: Wed Mar 13, 2024 10:44 am

Re: Anyone knows how to control this text pushing other text issue (see screens)

Post by dgames »

Works perfectly thanks :D !!
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Anyone knows how to control this text pushing other text issue (see screens)

Post by Tony Li »

Glad to help!
Post Reply