This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Text Object

A Text object is an object representing a plain text in a 3D space. The text is rendered into a texture that is applied to a flat polygon. It uses trilinear filtering and mipmaps to correctly display the text at any distance. There is no noise influence to the object and it is not distorted by TAA.Text对象是表示3D空间中纯文本的对象。文本被渲染为应用于平面多边形的纹理。它使用三线性过滤和mipmaps可以在任意距离正确显示文本。对物体没有任何噪声影响,并且不会受到TAA的失真。

The font can be represented as a TrueType font (TTF) or as a texture atlas with letters.字体可以表示为TrueType字体(TTF)或带有字母的纹理图集。

See Also
也可以看看#

  • The ObjectText class to edit text objects via APIObjectText类,用于通过API编辑文本对象

Adding a Text Object
添加文本对象#

To add a text object to the scene via UnigineEditor, do the following:要通过UnigineEditor将文本对象添加到场景中,请执行以下操作:

  1. Run the project with UnigineEditor.跑步UnigineEditor的项目。
  2. On the Menu bar, click Create -> Text.

    在菜单栏上,单击Create -> Text

  3. Place the Text object somewhere in the world.Text对象放置在世界上的某个地方。

Editing a Text Object
编辑文字对象#

Text Text input field. If the Rich text option is enabled, you can use tags for text formatting.文本输入字段。如果启用了Rich text选项,则可以使用标签用于文本格式。
Name Path to a *.ttf file or to a texture atlas with letters.
注意
Names of font files for bold, italic and bold italic fonts must have the b, i and bi postfixes correspondingly. For example: myfontb.ttf, myfontbi.ttf.Names of font files for bold, italic and bold italic fonts must have the b, i and bi postfixes correspondingly. For example: myfontb.ttf, myfontbi.ttf.
Names of font files for bold, italic and bold italic fonts must have the b, i and bi postfixes correspondingly. For example: myfontb.ttf, myfontbi.ttf.
*.ttf文件或带字母的纹理图集的路径。
注意
Names of font files for bold, italic and bold italic fonts must have the b, i and bi postfixes correspondingly. For example: myfontb.ttf, myfontbi.ttf.粗体,斜体和粗斜体字体的字体文件名称必须分别具有b, ibi后缀。例如:myfontb.ttf, myfontbi.ttf
Color Text color in the RGBA range.RGBA范围内的文本颜色。
Wrap Width Text wrap width in units. The text will wrap if its physical size will be greater than the set value. If 0 is set, text wrapping is disabled.
Wrap Width = 0Wrap Width = 0
Wrap Width = 5Wrap Width = 5
Wrap Width = 0Wrap Width = 5
文本换行宽度,以单位为单位。 如果文本的物理尺寸大于设置的值,则文本将自动换行。 如果设置了0,则禁用自动换行。
Wrap Width = 0包装宽度= 0
Wrap Width = 5包装纸宽度= 5
Size Font size, in dots. The more dots, the higher the size of the font. To match dots with a 3D space, there is a set value: 288 dots per unit. For example, if you have the Arial font with the size of 20, the physical height of the letter can be calculated as 20/288=0.0694 units.字体大小,以点为单位。点数越多,字体的大小越大。为了使点与3D空间匹配,需要设置一个值:每单位288个点。例如,如果您使用大小为20Arial字体,则字母的物理高度可以计算为20/288 = 0.0694单位。
Resolution Resolution of the texture into which the text will be rendered. The lower the value, the less detailed will be the text and the less video memory will be required for the texture.
注意
The resolution doesn't influence the text's physical size.The resolution doesn't influence the text's physical size.
Resolution = 50Resolution = 50
Resolution = 200Resolution = 200
The resolution doesn't influence the text's physical size.Resolution = 50Resolution = 200
文本将渲染到的纹理的分辨率。值越低,文本的细节越少,纹理所需的视频内存就越少。
注意
The resolution doesn't influence the text's physical size.分辨率不会影响文本的实际大小。
Resolution = 50分辨率= 50
Resolution = 200分辨率= 200
HSpacing Horizontal spacing between letters (a kerning value). This parameter affects the text's physical size.字母之间的水平间距(字距调整值)。此参数影响文本的实际大小。
VSpacing Vertical spacing between letters (a kerning value). This parameter affects the text's physical size.字母之间的垂直间距(字距调整值)。此参数影响文本的实际大小。
Rich text Flag indicating if the rich text formatting is enabled. The following tags are supported:
  • <b>text</b> specifies a bold text.<b>text</b> specifies a bold text.
  • <i>text</i> specifies an italic text.<i>text</i> specifies an italic text.
  • <br>text</br> inserts a single line break.<br>text</br> inserts a single line break.
  • <left>text</left> left-aligns the text.<left>text</left> left-aligns the text.
  • <right>text</right> right-aligns the text.<right>text</right> right-aligns the text.
  • <center>text</center> center-aligns the text.<center>text</center> center-aligns the text.
  • <p align=left|right|center|justify>text</p> specifies the alignment of the text within a paragraph:
    • left — left-aligns the textleft — left-aligns the text
    • right — right-aligns the textright — right-aligns the text
    • center — center-aligns the textcenter — center-aligns the text
    • justify — stretches the lines so that each line has equal width (like in newspapers and magazines)justify — stretches the lines so that each line has equal width (like in newspapers and magazines)
    注意
    Text alignment requires text wrapping to be enabled: the value of the Wrap Width parameter must be greater than 0.Text alignment requires text wrapping to be enabled: the value of the Wrap Width parameter must be greater than 0.
  • <font size=12 color=magenta face=verdana> text</font> specifies the font face, font size, and color of text.<font size=12 color=magenta face=verdana> text</font> specifies the font face, font size, and color of text.
  • <sub> text</sub> defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font.<sub> text</sub> defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font.
  • <sup> text</sup> defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font.<sup> text</sup> defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font.
注意
<image/> and <table/> tags are not available.<image/> and <table/> tags are not available.
<b>text</b> specifies a bold text.<i>text</i> specifies an italic text.<br>text</br> inserts a single line break.<left>text</left> left-aligns the text.<right>text</right> right-aligns the text.<center>text</center> center-aligns the text.left — left-aligns the textright — right-aligns the textcenter — center-aligns the textjustify — stretches the lines so that each line has equal width (like in newspapers and magazines)Text alignment requires text wrapping to be enabled: the value of the Wrap Width parameter must be greater than 0.<font size=12 color=magenta face=verdana> text</font> specifies the font face, font size, and color of text.<sub> text</sub> defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font.<sup> text</sup> defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font.<image/> and <table/> tags are not available.
指示是否启用RTF格式的标志。 支持以下标签:
  • <b>text</b> specifies a bold text.<b>文字</ b>指定粗体文本。
  • <i>text</i> specifies an italic text.<i>文字</ i>指定斜体文本。
  • <br>text</br> inserts a single line break.<br>文字</br>插入一个换行符。
  • <left>text</left> left-aligns the text.<left>文字</ left>左对齐文本。
  • <right>text</right> right-aligns the text.<right>文字</ right>右对齐文本。
  • <center>text</center> center-aligns the text.<center>文字</ center>居中对齐文本。
  • <p align=left|right|center|justify>text</p>指定段落中文本的对齐方式:
    • left — left-aligns the text剩下—左对齐文本
    • right — right-aligns the text正确的—右对齐文本
    • center — center-aligns the text中央—居中对齐文本
    • justify — stretches the lines so that each line has equal width (like in newspapers and magazines)证明合法—拉伸线条,使每条线条的宽度相等(例如报纸和杂志上的线条)
    注意
    Text alignment requires text wrapping to be enabled: the value of the Wrap Width parameter must be greater than 0.文本对齐要求启用文本换行:Wrap Width参数的值必须大于0
  • <font size=12 color=magenta face=verdana> text</font> specifies the font face, font size, and color of text.<font size = 12 color =洋红色face = verdana>文字</ font>指定字体,字体大小和文本颜色。
  • <sub> text</sub> defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font.<sub>文字</ sub>定义下标文本。下标文字显示在正常行下方半个字符,有时以较小的字体显示。
  • <sup> text</sup> defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font.<sup>文字</ sup>定义上标文本。上标文字显示在法线上方半个字符,有时以较小的字体呈现。
注意
<image/> and <table/> tags are not available.<image/><table/>标签不可用。
Depth Test Flag indicating if depth test is performed for the text.指示是否对文本执行深度测试的标志。
Outline Flag indicating if the text outline is enabled. The outline looks like the dark shadow in the right lower corner of the text and is displaced by one dot.指示文本轮廓是否启用的标志。轮廓看起来像文本右下角的暗影,并且偏移了一个点。
最新更新: 2024-08-16
Build: ()