Realot StudioDocs
Components

TextRenderer

Realot Studio TextRenderer component reference: fields, script API, behavior and examples.

View as Markdownllms.txt
ScopeThis page documents the TextRenderer component in Realot Studio. Runtime fields are serialized scene data; the Script API section lists only members intentionally exposed to game scripts.
Where to find it in the editorTop UI menu → Text, or Inspector → Add Component → Text; screen-space text is authored from the same Inspector component.

#What it does

Render text either in world space or as screen-space UI.

Component setup & editor toolsTextRenderer displays text as a screen/world-space rendering component depending on the entity/camera context.

#How to add and use TextRenderer

Editor path: Select the target entity in the Hierarchy (left side) → look at the Inspector (right side) → click Add Component at the bottom of the Inspector → search for TextRenderer → click the component row. The Add Component picker is a centered modal with a search box; it only lists components not already attached.

For components with a dedicated editor tool, the tool is opened or activated from the location described below. Do not assume that adding the component alone activates its editor; some systems require a separate window, panel, or viewport tool.

#Component setup & editor tools

  • Inspector → TextRenderer: edit the text and presentation properties. For runtime changes, use the documented this.text API.

#What you should see after adding it

The component appears as its own section in the Inspector. Its serialized settings are listed in the Component data table below. If a field is conditional, it appears only when the relevant mode/type is selected. If a field is a runtime state field (for example grounded or resolved velocity), treat it as read-only diagnostic state unless the API reference explicitly documents it as writable.

#How to read the settings

For every setting below, the documentation distinguishes type, default, meaning, and tuning direction where behavior is known. When a value represents a direction, use the engine's coordinate convention documented in Coordinate system; do not substitute Unity/Godot conventions.

#Component data

FieldTypePurposeDefault
valuestringDisplayed text.Text
fontSizenumberFont size.32
colorhex color stringText color.#ffffff
fontFamilystringFont family name.Arial
boldbooleanBold text.false
italicbooleanItalic text.false
alignstring"left" | "center" | "right" — multi-line text alignmentleft
anchorXnumber0–1, this text's own pivot point (0.5,0.5 = centered on Transform.x/y, matching a sprite's default anchor)0.5
anchorYnumberVertical anchor from 0 to 1.0.5
opacitynumberOpacity.1
screenSpacebooleansee file header — true = fixed UI overlay, false = world-spacetrue
wordWrapbooleanEnable wrapping.false
wrapWidthnumberpx — only used while wordWrap is true300

#Tuning behavior

These are the practical direction-of-change rules for the most important controls on this component.

SettingWhat changing it does
fontSizeHigher = larger text.
anchorX / anchorY0 = top/left pivot, 0.5 = center, 1 = bottom/right pivot for the text block.
wrapWidthOnly used when wordWrap is enabled; larger width permits longer lines before wrapping.

#Script API

MemberKindDescription
alignProperty (read/write)The `this.text` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
anchorXProperty (read/write)The `this.text` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
anchorYProperty (read/write)Vertical anchor.
boldProperty (read/write)Bold toggle.
colorProperty (read/write)Hex text color.
fontFamilyProperty (read/write)Font family.
fontSizeProperty (read/write)Font size.
italicProperty (read/write)Italic toggle.
opacityProperty (read/write)The `this.text` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
screenSpaceProperty (read/write)The `this.text` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
valueProperty (read/write)The `this.text` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
wordWrapProperty (read/write)Enable word wrapping.
wrapWidthProperty (read/write)The `this.text` sub-object exposed to user scripts (see scripting/ScriptAPI.js).

#Examples

js
this.text.value = "Score: " + score;
js
this.text.screenSpace = true;
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.