Page 1 of 1

Have bark dialogue resize to actual text width when text wraps

Posted: Fri Jan 08, 2021 10:50 am
by pciol
Hello,

I'm running into an issue that when text wraps in a bark the dialogue background does not resize to the actual text width and consequently an unpleasant visual.

In the attached image, which is a screenshot taking from the scene editor while the game was paused, one can see that there is some extra spacing (which I figure has something to do with the way wrapping works). I'd like to know how to get the dialogue background to match the actual text width. Is there a "quick fix" or does one need to take another approach to how the bark component is setup all together?

For reference what you see in the attached image is a very lightly modified version of the "Bubble Template Standard Bark UI" prefab - all I've done is change the font and the the image on the UI component.

Thanks,

Re: Have bark dialogue resize to actual text width when text wraps

Posted: Fri Jan 08, 2021 1:10 pm
by Tony Li
Hi,

That's the way Unity UI works, unfortunately. It's not specific to the Dialogue System. When Text or TextMeshProUGUI reaches a point where it needs to wrap, it wraps but doesn't readjust the rect transform size. Can you center your text? This way an equal amount will be on either side, although the lines won't be left-justified.

Re: Have bark dialogue resize to actual text width when text wraps

Posted: Sun Jan 10, 2021 11:26 am
by pciol
I noticed that centering can make the effect less-pronounced, but I'd really like to have the text left-justified. Surely someone else has run into this problem and come up with a solution?