This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.ObjectText Class

Inherits: Object

The class is used to render flat text in a scene.

ObjectText Class

Properties

float TextWrapWidth#

The current text wrap width in units.
set
Sets 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.
set value - Wrap width in units.

vec4 TextColor#

The color of the text.
set
Sets the color of the text.
set value - The color of the text in the RGBA range.

string Text#

The text set in the node.
set
Sets the text for the node. Can be either a plain or rich text.
set value - The text.

int DepthTest#

A value indicating if the text object uses depth test.
set
Sets a value indicating if depth test should be used for the text object.
set value - 1 to use depth test; otherwise, 0.

int FontOutline#

The flag indicating if the text outline is enabled.
set
Sets the outline for the text. The outline looks like the dark shadow in the right lower corner of the text and is displaced by one dot.
set value - 1 — to enable the outline; 0 — to disable.

int FontVSpacing#

The vertical spacing between letters (kerning value).
set
Sets the vertical spacing between letters (kerning value). This parameter influences the text's physical size.
set value - The vertical spacing value.

int FontHSpacing#

The horizontal spacing between letters (kerning value).
set
Sets the horizontal spacing between letters (kerning value). This parameter influences the text's physical size.
set value - The horizontal spacing value.

int FontResolution#

The text resolution value.
set
Sets the resolution of the texture into which the text will be rendered. The lower the value, the less detailed will be the text, the less video memory will be required for the texture. It doesn't influence the text's physical size.
set value - The font resolution.

int FontSize#

The text font size.
set
Sets the size of the text font. 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.
set value - The size of the text, in dots.

int FontRich#

The value indicating if the rich text is enabled. when enabled, tags can be used for text formatting.
set
Sets the flag indicating if the rich text is enabled. When enabled, the following tags can be used for text formatting:
  • <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.
  • <p align=left|right|center|justify>text</p> specifies the alignment of the text within a paragraph:
    • 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)
    Notice
    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.
Notice
<image/> and <table/> tags are not available.
set value - 1 — to enable the rich text; 0 — to disable.

string FontName#

The path to the ttf font specified in the node.
Notice
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.
set
Sets the path to the TTF font.
Notice
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.
set value - The path to the TTF font relatively to the data directory.

Members


static ObjectText ( ) #

Default constructor. Creates an empty object with no text and font set.

static ObjectText ( string font_name ) #

Constructor. Creates an object with no text but with the specified font.

Arguments

  • string font_name - The path to the TTF font relatively to the data directory.

static ObjectText ( string font_name, string text ) #

Constructor. Creates an object with the set font and text.

Arguments

  • string font_name - The path to the TTF font relatively to the data directory.
  • string text - The text (can be either plain or rich).

static int type ( ) #

Returns the type of the object.

Return value

Object Text type identifier.
Last update: 2020-07-31
Build: ()