文本网格Unity 中主要的图形基元。网格构成了 3D 世界的很大一部分。Unity 支持三角形或四边形多边形网格。Nurbs、Nurms、细分曲面必须转换为多边形。更多信息
参见术语表组件生成显示文本字符串的 3D 几何体。
注意:文本网格组件的功能有限。有关显示文本的更新、功能更全面的方法的信息,请参见创建用户界面 (UI)。
要创建新的文本网格,请转到组件 > 网格 > 文本网格。
属性 | 功能 |
---|---|
文本 | 将要渲染的文本 |
Z 偏移 | 绘制时文本应从 transform.position.z 偏移多远 |
字符大小 | 每个字符的大小(这会缩放整个文本。) |
行间距 | 文本行之间将有多少空间。 |
锚点 | 文本的哪个点与变换的位置共享。 |
对齐方式 | 文本行如何对齐(左、右、居中)。 |
制表符大小 | 将为制表符“\t”字符插入多少空间。这是“空格键”字符偏移量的倍数。 |
字体大小 | 字体的大小。这可以覆盖动态字体的尺寸。 |
字体样式 | 字体的渲染样式。字体需要标记为动态。 |
富文本 | 选中后,这将在渲染文本时启用标签处理。 |
字体 | 渲染文本时要使用的TrueType 字体。 |
颜色 | 渲染文本时要使用的全局颜色。 |
文本网格
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.