Skip to main content

text3d

3d · render · 22 properties · 3D

A block of text drawn in the 3D pass on a quad that faces the camera, shaped by the engine's fonts and sized at pixels_per_unit font pixels to the world unit.

In a scene, text3d is the node key that applies it. A script reaches the same properties through node.text3d.get() and node.text3d.set(table).

Properties

propertytypedefaultdescription
alignenumcenterWhere the block sits across the node's origin One of start, center, end.
billboardbooltrueTurn to face the camera every frame; off leaves it in the node's own plane
colorcolor[1,1,1,1]Tint, as channel floats or #rrggbb / #rrggbbaa
depth_testbooltrueLet the scene hide it; off draws it over everything
double_sidedbooltrueDraw the back of the quad as well as the front
familyenumuiWhich of the project's font chains to shape with One of ui, heading, mono, icons.
fontstringA project-relative AngelCode .fnt naming a bitmap face; empty shapes with the project's vector fonts
font_sizefloat32Height in font pixels, before pixels_per_unit sizes it in the world At least 1.
font_styleenumnormalUpright or italic One of normal, italic.
font_weightint400Stroke weight, 400 regular and 700 bold Range 100–900.
letter_spacingfloat0Extra space between glyphs, in font pixels
line_heightfloat0Baseline to baseline as a multiple of the size; zero takes the default At least 0.
markupboolfalseRead the text as markup: bold, italic, colour, alignment, wave and inline images
max_widthfloat0Font pixels the lines wrap at; zero runs the text on one line At least 0.
outline_colorcolor[0,0,0,1]The outline's colour
outline_sizefloat0Font pixels the outline reaches around the glyphs; zero draws none At least 0.
pixels_per_unitfloat100Font pixels to one world unit, sizing the block the way a sprite is sized At least 0.01.
shadow_colorcolor[0,0,0,0.5]The shadow's colour
shadow_offset_xfloat0Font pixels the shadow is moved along x; zero with y draws none
shadow_offset_yfloat0Font pixels the shadow is moved along y
textstringThe text drawn; text_key wins over it
text_keystringA key in the project's strings, re-read every frame so a language change shows at once

Script functions

Methods of node.text3d, the handle a node carrying this component exposes. Each is also a free function on its module, taking the node as its first argument. Every handle also has get(), set(table), has() and remove().

From render:

methodwhat it does
set_text(string)Replace the text a node draws. The block re-shapes on the next frame; a text_key on the node still wins over it.
text() -> stringThe text a node draws, as it was last set — not the localized string a text_key resolves to.