简体   繁体   English

如何获得全文显示在Unity 3D UI中?

[英]How do I get the full text to show in Unity 3D UI?

I am trying to get the full text to display when entering play mode but its only showing the first few words. 我试图进入播放模式时要显示全文,但只显示前几个单词。

I already set the Horizontal and Vertical overflow to wrap and truncate. 我已经设置了水平和垂直溢出来包装和截断。

Any help is greatly appreciated. 任何帮助是极大的赞赏。

Unity游戏的屏幕截图

To show all the text the rect transform should be big enough to contain all the text when using (Wrap, Truncate) settings. 为了显示所有文本,rect转换应足够大,以在使用(环绕,截断)设置时包含所有文本。

Prese "T" while the text object is selected to see the size of the transform, you can also see in inspector, it is 160w,30h. 选中文本对象以查看变换的大小时,请显示“ T” ,您也可以在检查器中看到它为160w,30h。 Which is way too small for a large text. 对于大文本来说,这太小了。 Increase it about 300w,300h and then set paragraph overflow mode horizontal: Wrap, vertical: Overflow. 将其增加约300w,300h,然后将段落溢出模式设置为水平:环绕,垂直:溢出。 Setting vertical to overflow might result in text going out of the panel but it would give you an idea how tall your panel should be to display all the text in boundary. 将“垂直”设置为“溢出”可能会导致文本超出面板,但可以使您了解面板在边界显示所有文本的高度。

You can also use best fit option to size down the text to fit inside the transform boundary. 您也可以使用最佳适合选项来缩小文本的大小以适合转换边界。

在此处输入图片说明

You have given your font size as 24. But it seems there's a lot of text to show. 您的字体大小为24。但是似乎有很多文本要显示。 I would suggest make the text box bigger. 我建议使文本框更大。 Then select the Best Fit option in the inspector. 然后在检查器中选择“ 最适合”选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM