π TextRender
A Text Render class is useful for spawning Texts in 3D world, you can even attach it to other entities.
πAuthority
πͺInheritance
π§βπ»API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
π Examplesβ
local my_text_render = TextRender(
Vector(-100, 200, 300),
Rotator(),
"My Awesome Text",
Vector(1, 1, 1), -- Scale
Color(1, 0, 0), -- Red Color
FontType.OpenSans,
TextRenderAlignCamera.FaceCamera
)
info
If you desire your TextRender to be visible through walls, replace it's material with the nanos Default TranslucentDepth one!
SetMaterial("nanos-world::M_Default_Translucent_Lit_Depth")
.
You can also tweak it's color and other properties using the Material methods.
π Constructorsβ
Default Constructor
local my_textrender = TextRender(location, rotation, text, scale?, color?, font_type?, align_camera?)
Type | Name | Default | Description |
---|---|---|---|
Vector | location | Required parameter | No description provided |
Rotator | rotation | Required parameter | No description provided |
string | text | Required parameter | No description provided |
Vector | scale | Vector(1, 1, 1) | No description provided |
Color | color | Color(1, 1, 1, 1) | No description provided |
FontType | font_type | FontType.Roboto | No description provided |
TextRenderAlignCamera | align_camera | TextRenderAlignCamera.Unaligned | No description provided |
πΏ Static Functionsβ
Inherited Entity Static Functions
π¦ Functionsβ
Inherited Entity Functions
Inherited Actor Functions
Inherited Paintable Functions
Returns | Name | Description | |
---|---|---|---|
SetColor | Sets the Color | ||
SetFont | Sets the Font | ||
SetFreeze | Freeze mesh rebuild, to avoid unnecessary mesh rebuilds when setting a few properties together | ||
SetGlyphSettings | Sets the Glyph representation settings to generate the 3D Mesh for this text render | ||
SetMaxSize | Sets the Max Size of the TextRender, optionally scaling it proportionally | ||
SetText | Sets the Text | ||
SetTextSettings | Sets the Text & Font settings for this text render |
SetColor
Sets the Color (Internally this will call the SetMaterialColorParameter("Tint", color)
method)
my_textrender:SetColor(color)
Type | Parameter | Default | Description |
---|---|---|---|
Color | color | Required parameter | No description provided |
SetFont
Sets the Font
my_textrender:SetFont(font_type)
Type | Parameter | Default | Description |
---|---|---|---|
FontType | font_type | Required parameter | No description provided |
SetFreeze
Freeze mesh rebuild, to avoid unnecessary mesh rebuilds when setting a few properties together
my_textrender:SetFreeze(freeze)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | freeze | Required parameter | No description provided |
SetGlyphSettings
Sets the Glyph representation settings to generate the 3D Mesh for this text render
my_textrender:SetGlyphSettings(extrude?, level?, bevel_type?, bevel_segments?, outline?)
Type | Parameter | Default | Description |
---|---|---|---|
float | extrude? | 0 | No description provided |
float | level? | 0 | No description provided |
TextRenderBevelType | bevel_type? | TextRenderBevelType.Convex | No description provided |
integer | bevel_segments? | 8 | No description provided |
boolean | outline? | false | No description provided |
SetMaxSize
Sets the Max Size of the TextRender, optionally scaling it proportionally
my_textrender:SetMaxSize(max_width?, max_height?, scale_proportionally?)
Type | Parameter | Default | Description |
---|---|---|---|
integer | max_width? | 0 | No description provided |
integer | max_height? | 0 | No description provided |
boolean | scale_proportionally? | true | No description provided |
SetText
Sets the Text
my_textrender:SetText(text)
Type | Parameter | Default | Description |
---|---|---|---|
string | text | Required parameter | No description provided |
SetTextSettings
Sets the Text & Font settings for this text render
my_textrender:SetTextSettings(kerning?, line_spacing?, word_spacing?, horizontal_alignment?, vertical_alignment?)
Type | Parameter | Default | Description |
---|---|---|---|
float | kerning? | 0 | No description provided |
float | line_spacing? | 0 | No description provided |
float | word_spacing? | 0 | No description provided |
TextRenderHorizontalAlignment | horizontal_alignment? | TextRenderHorizontalAlignment.Center | No description provided |
TextRenderVerticalAlignment | vertical_alignment? | 0TextRenderVerticalAlignment.Center | No description provided |