__文本__控件向用户显示非交互式文本。此控件可用于为其他 GUI 控件提供标题或标签,或显示说明或其他文本。
属性: | 功能: |
---|---|
Text | 控件显示的文本。 |
Character | |
Font | 用于显示文本的字体。 |
Font Style | 应用于文本的样式。选项包括 Normal、Bold、Italic 和 Bold And Italic。 |
Font Size | 显示的文本的大小。 |
Line Spacing | 文本行之间的垂直间距。 |
Rich Text | 文本中的标记元素是否应解释为富文本样式? |
Paragraph | |
Alignment | 文本的水平和垂直对齐方式。 |
Align by Geometry | 使用字形几何形状的范围(而不是字形指标)执行水平对齐。 |
Horizontal Overflow | 用于处理文本太宽而无法放入矩形内的情况的方法。提供的选项为 Wrap 和 Overflow。 |
Vertical Overflow | 用于处理换行文本太高而无法放入矩形内的情况的方法。提供的选项为 Truncate 和 Overflow。 |
Best Fit | Unity 应该忽略大小属性并尝试直接将文本放入控件的矩形? |
Color | 用于渲染文本的颜色。 |
Material | 用于渲染文本的材质。 |
默认文本元素如下所示:
有些控件(如按钮和开关)内置了文本描述。对于没有隐式文本的控件(如滑动条),可使用通过文本控件创建的标签来指示用途。文本对于列出说明、故事文本、对话和法律免责声明也很有用。
文本控件提供字体大小、样式以及文本对齐方式等常用参数。启用 Rich Text 选项后,文本中的标记元素将视为样式信息,因此可仅让单个单词或短段使用粗体或不同颜色,等等(请参阅有关富文本的页面以获取有关标记方案的详细信息)。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.