text
The text namespace — the engine's Luau API reference for text.
The text namespace — 9 functions.
globals/text/create
globals/text/create(options: table) -> any
Create a text handle from an initial content + style table. The handle
owns a runtime GPU texture (see text.textureGuid); pass it to every other
call.
globals/text/destroy
globals/text/destroy(handle: any)
Destroy a text handle and release its raster + glyph layout.
globals/text/listFonts
globals/text/listFonts() -> { string }
List the font families currently available to the text system.
globals/text/loadFont
globals/text/loadFont(ref: any) -> any
Load a font from an asset reference so it becomes available to
setStyle's fontFamily.
globals/text/measure
globals/text/measure(handle: any) -> any
Measure the rasterised text in pixels without producing a texture.
globals/text/rasterize
globals/text/rasterize(handle: any, texture: any, scale: number?) -> any
Rasterise the handle's current text + style into the given runtime GPU
texture. Bind that texture's guid as a material's base_color_texture to
display the text; re-rasterising the same texture overwrites it in place.
globals/text/setStyle
globals/text/setStyle(handle: any, style: table)
Replace the handle's style. Fields not present keep their current value.
globals/text/setText
globals/text/setText(handle: any, content: string)
Replace the handle's text content.
globals/text/textureGuid
globals/text/textureGuid(handle: any) -> string?
The runtime GPU texture guid this handle rasterises into — bind it as a
material texture (base_color_texture) to display the text.