纳金网

标题: [Unity 组件参考手册]组件:网格组件之文本网格 [打印本页]

作者: .    时间: 2013-2-2 17:40
标题: [Unity 组件参考手册]组件:网格组件之文本网格
3D Meshes are the main graphics primitive of Unity. Various components exist in Unity to render regular or skinned meshes, trails or 3D lines.3D网格是Unity中最重要的图形元素。在Unity中存在多种组件用于渲染标准网格或者蒙皮网格、拖尾或者3D线条。
下面介绍文本网格:The Text Mesh generates 3D geometry that displays text strings.文本网格生成用于显示字符串的3D几何体。The Text Mesh Inspector 文本网格检视面板You can create a new Text Mesh from GameObject->Create Other->3D Text.你可以创建一个文本网格 从菜单 GameObject->Create Other->3D Text。
-----------------------------------------------------------------------[Properties 属性]    Text 文本
    The text that will be rendered 将要渲染的文本
    Offset Z 偏移Z轴
    How far should the text be offset from the transform.position.z when drawing
    绘制时文本的Z轴偏移量(transform.position.z)
    Character Size 字符大小
    The size of each character (This scales the whole text)
    每个字符的大小(这个是整个文本的放大比例)
    Line Spacing 行间距
    How much space will be in-between lines of text. 文本的行间距
    Anchor 锚
    Which point of the text shares the position of the Transform.
    文本上的哪个点共享此变换的位置。
    Alignment 对齐
    How lines of text are aligned (Left, Right, Center).
    文本的水平对齐方式(左,右,中)
    Tab Size 制表符大小
    How much space will be inserted for a tab '        ' character. This is a multiplum of the 'spacebar' character offset.
    替代制表符('        ')多少空格。这个属性保存同等大小的空格的数量
    Font 字体
    The ***eType Font to use when rendering the text.
    渲染时所使用的***eType字体-----------------------------------------------------------------------[Details 细节]Text Meshes can be used for rendering road signs, graffiti etc. The Text Mesh places text in the 3D scene. To make generic 2D text for GUIs, use a GUI Text component instead.文本网格可以用于渲染路牌、涂鸦(译者注:cs中的喷图)等。文本网格放置文本到3d场景中。制作简单的2D界面文本请使用GUI Text 组件。Follow these steps to create a Text Mesh with a custom Font:以下步骤用于创建一个带有自定义字体的文本网格。    Import a font by dragging a ***eType Font - a .ttf file - from the Explorer (Windows) or Finder (OS X) into the Project View.
    在资源管理器中拖动一个***eType字体文件(a.ttf)到项目视图。从而导入一个字体。
    Select the imported font in the Project View.
    在项目试图中选择已导入的字体。
    Choose GameObject->Create Other->3D Text.
    在菜单中选择 GameObject->Create Other->3D Text 。You have now created a text mesh with your custom ***eType Font. You can scale the text and move it around using the Scene View's Transform controls.你已经创建了一个带有你自定义***eType字体的文本网格。你可以使用场景视图中的变换控制器来放大这个文本,或者四处移动它。Note: If you want to change the font for a Text Mesh, need to set the component's font property and also set the texture of the font material to the correct font texture. This texture can be located using the font asset's foldout. If you forget to set the texture then the text in the mesh will appear blocky and misaligned.注意:如果你想改变一个文本网格的字体。需要设置这个组件的字体属性,或者设置这个字体材质为需要到的字体纹理。这个纹理可以在字体资源的分页下面找到(译者注:项目面板中字体资源的下拉箭头下的文件)。如果你忘记设置这个纹理。文本网格中的文字将被显示为不规则的方块。
-----------------------------------------------------------------------[Hints 提示]    When entering text into the Text property, you can create a line break by holding Alt and pressing Return.
    当你在文本属性中输入文本的时候,你可以通过按住alt键再敲击Return键(Mac操作系统)来输入一个换行符。
    (译者注:Windows 中无法用此方法换行。可以在其他文本编辑器中输入换行的文本再粘贴过来。)
    You can download free ***eType Fonts from 1001freefonts.com (download the Windows fonts since they contain ***eType Fonts).
    你可以在1001freefonts.com下载免费的***eType字体(下载Windows字体,里面包括***eType字体)。
    If you are scripting the Text property, you can add line breaks by inserting the escape character "
" in your strings.
    如果你用脚本指定文本属性你可以在字符串中插入一个"
"来输入一个换行符。 【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/




欢迎光临 纳金网 (http://www.narkii.com/club/) Powered by Discuz! X2.5