Skip to main content

TextRender

TextRender creates 3D floating text in the world that always faces forward by default. It’s useful for labeling objects, creating signs, markers, or displaying messages in the game environment. The text can be customized with different fonts, colors, sizes, and rotations, making it suitable for both debug information and immersive in-world displays

/// tip TextRender is an Actor so it inherits all functions from Actor ///

Constructor

Example
local text = TextRender(
Vector(0, 200, 100),
Rotator(0, 0, 0),
"Hello World",
Vector(2, 2, 1),
Color(255, 255, 255, 255),
FontType.RobotoMono
)
NameTypeDefaultDescription
LocationVector(0,0,0)World-space position to place the text
RotationRotator(0,0,0)World-space rotation of the text actor
TextstringRequiredThe text string to display
ScaleVector(1,1,1)Scale of the text in X and Y directions
ColorColor(255,255,255,255)Text render color (RGB + Alpha)
FontParamenumFontType.RobotoEngine font enum or asset path to a custom font

Functions

SetText

Updates the text content

  • message: string
Example
text:SetText("Updated Message")

SetTextRenderColor

Changes the text color

Example
text:SetTextRenderColor(Color(255, 0, 0, 255)) -- red

SetFont

Changes the font to an engine enum or a loaded asset

Example
text:SetFont(FontType.RobotoMono)

SetXScale

Sets horizontal scale (width)

  • scale: number
Example
text:SetXScale(2.0)

SetYScale

Sets vertical scale (depth)

  • scale: number
Example
text:SetYScale(1.0)