Text
The Text control displays a non-interactive piece of text to the user. This can be used to provide captions or labels for other GUI controls or to display instructions or other text.
文本控件向用戶顯示一個非交互式的文本片段。 它可以作為其他GUI控件提供標題或標簽,或作為說明文本,或者其他用途。
Properties
屬性
Property: | Function: |
---|---|
Text | The text displayed by the control. |
Character | |
Font | The Font used to display the text. |
Font Style | The style applied to the text. The options are Normal, Bold, Italic and Bold And Italic. |
Font Size | The size of the displayed text. |
Line Spacing | The vertical separation between lines of text. |
Rich Text | Should markup elements in the text be interpreted as Rich Text styling? |
Paragraph | |
Alignment | The horizontal and vertical alignment of the text. |
Align by Geometry | Use the extents of glyph geometry to perform horizontal alignment rather than glyph metrics. |
Horizontal Overflow | The method used to handle the situation where the text is too wide to fit in the rectangle. The options are Wrap and Overflow. |
Vertical Overflow | The method used to handle the situation where wrapped text is too tall to fit in the rectangle. The options are Truncate and Overflow. |
Best Fit | Should Unity ignore the size properties and simply try to fit the text to the control’s rectangle? |
Color | The color used to render the text. |
Material | The Material used to render the text. |
屬性 | 功能 |
---|---|
Text | 由控件顯示的文本 |
Character | |
Font | 用於顯示文本的字體 |
Font Style | 應用於文本的樣式。 選項是正常,粗體,斜體或粗體加斜體 |
Font Size | 文字的大小 |
Line Spacing | 行間距 |
Rich Text | 文本中的標記元素是否應該被解釋為Rich Text樣式 |
Paragraph | |
Alignment | 文本的水平和垂直對齊 |
Align by Geometry | 使用字形幾何的范圍來執行水平對齊而不是字形度量 |
Horizontal Overflow | 該方法用於處理文本太寬以至於無法放入矩形區域的情況。 選項是Wrap和Overflow |
Vertical Overflow | 該方法用於處理文本太高以至於無法放入矩形區域的情況。選項是Truncate和Overflow |
Best Fit | Unity是否要忽略尺寸屬性,只是簡單地將文本放到控件的矩形區域中 |
Color | 文本的顏色 |
Material | 文本的Material |
A default text element looks like this:
默認的文本元素如下所示:
A Text element.
Details
詳細
Some controls (such as Buttons and Toggles) have textual descriptions built-in. For controls that have no implicit text (such as Sliders), you can indicate the purpose using a label created with a Text control. Text is also useful for lists of instructions, story text, conversations and legal disclaimers.
有一些空間(比如Buttons 和 Toggles)有內置的文本。對於沒有隱式文本的控件(比如Sliders),你可以創建一個Text控件來達到目的。Text還可以用來顯示說明列表、故事、對話和免責聲明
The Text control offers the usual parameters for font size, style, etc, and text alignment. When the Rich Text option is enabled, markup elements within the text will be treated as styling information, so you can have just a single word or short section in boldface or in a different color, say (see the page about Rich Text for details of the markup scheme).
Text提供字體大小、樣式、文本對齊等常用參數。當Rich Text被選中,text中的標簽元素會被當做樣式信息,所以你可以只讓一個字或者一小段話加粗或者改變顏色(在關於Rich Text的頁面中獲得關於標簽的更多信息)
Hints
提示