朱峰社區(qū)首頁 朱峰社區(qū)

搜索資源 注冊|登陸

等待

返回 展開菜單
按功能 按軟件

Unity3D游戲制作教程

Unity3D游戲制作教程

包含5節(jié)視頻教程

本系列包含Unity3D介紹、Unity3D導出人物、Unity3D導出場景、Unity3D導出動作、游戲測試最終完成一個簡單的游戲。是一套非常完整的Unity3D游戲制作教程。

關閉

Unity組件:Text Mesh 文本網格

關注:3050 留言:0 樓主:星星知我心 發(fā)帖時間:15年11月16日

星星知我心

普通會員

星星知我心

社區(qū)朋友:2級

關注2762人

  • 積分

    41

  • 登陸

    2

  • 發(fā)帖

    6

  • 作品

    1

間隔線

The Text Mesh generates 3D geometry that displays text strings.

文本網格生成用于顯示字符串的3D幾何體。

文本網格 TextMesh
The Text Mesh Inspector 文本網格檢視面板

You can create a new Text Mesh from GameObject->Create Other->3D Text.

你可以創(chuàng)建一個文本網格 從菜單 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 '\t' character. This is a multiplum of the 'spacebar' character offset.
    替代制表符('\t')多少空格。這個屬性保存同等大小的空格的數量
  • Font 字體
    The TrueType Font to use when rendering the text.
    渲染時所使用的TrueType字體
Details 細節(jié)

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:

以下步驟用于創(chuàng)建一個帶有自定義字體的文本網格。

  1. Import a font by dragging a TrueType Font - a .ttf file - from the Explorer (Windows) or Finder (OS X) into the Project View.
    在資源管理器中拖動一個TrueType字體文件(a.ttf)到項目視圖。從而導入一個字體。
  2. Select the imported font in the Project View.
    在項目試圖中選擇已導入的字體。
  3. Choose GameObject->Create Other->3D Text.
    在菜單中選擇 GameObject->Create Other->3D Text 。

You have now created a text mesh with your custom TrueType Font. You can scale the text and move it around using the Scene View's Transform controls.

你已經創(chuàng)建了一個帶有你自定義TrueType字體的文本網格。你可以使用場景視圖中的變換控制器來放大這個文本,或者四處移動它。

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.

注意:如果你想改變一個文本網格的字體。需要設置這個組件的字體屬性,或者設置這個字體材質為需要到的字體紋理。這個紋理可以在字體資源的分頁下面找到(譯者注:項目面板中字體資源的下拉箭頭下的文件)。如果你忘記設置這個紋理。文本網格中的文字將被顯示為不規(guī)則的方塊。

Hints 提示
  • When entering text into the Text property, you can create a line break by holding Alt and pressing Return.
    當你在文本屬性中輸入文本的時候,你可以通過按住alt鍵再敲擊Return鍵(Mac操作系統)來輸入一個換行符。
    (譯者注:Windows 中無法用此方法換行?梢栽谄渌谋揪庉嬈髦休斎霌Q行的文本再粘貼過來。)
  • You can download free TrueType Fonts from 1001freefonts.com (download the Windows fonts since they contain TrueType Fonts).
    你可以在1001freefonts.com下載免費的TrueType字體(下載Windows字體,里面包括TrueType字體)。
  • If you are scripting the Text property, you can add line breaks by inserting the escape character "\n" in your strings.
    如果你用腳本指定文本屬性你可以在字符串中插入一個"\n"來輸入一個換行符。

贊0 踩0

未知用戶

2005-2025 朱峰社區(qū) 版權所有 遼ICP備2021001865號-1
2005-2025 ZhuFeng Community All Rights Reserved

VIP

朱峰社區(qū)微信公眾號

回頂部

1.復制文本發(fā)給您的QQ好友或群、微信等;好友點擊鏈接以后,轉發(fā)就成功了。 2.如朋友點擊您的鏈接,您需要需刷新一下才行;同一個好友僅能點擊一次。
購買VIP,觀看所有收費教程!!