Text / UI
Text / UI renders labels and live values in 2D and 3D Objects. An Object can have several named Text components. Use Object components for definitions and instance overrides.
The content editor manages templates and character-range formatting beyond these exposed fields. Content comes from textTemplate first. Next comes a valueFormat containing {; otherwise, Text uses base text with its legacy binding slots. See Text and Live Values for authoring, live values, fonts, and wrapping.
Presentation Space determines length units: Window / UI uses pixels, while world Text uses meters in both 2D and 3D. Font Size, spacing, local positions, and local extents follow that space. Rotations use degrees.
Fit to Text (auto) derives both rendered dimensions from content. Wrap to Width (wrap) uses an authored width and derives height from wrapped lines. The stored Height field is separate from the rendered height. Change Font Size to change type size.
Defaults are normalized values for an empty component; presets and authored Objects can start differently. Writable means exposed for Logic property writes.
Properties
| Property and path | Type | Factory default | Behavior | Writable |
|---|---|---|---|---|
| Text (text) | text | “” | Base authored text, whose content can be used by a template or combined with values from its legacy binding slots. | Yes |
| Binding (binding) | text | “” | Primary legacy binding slot, whose value can appear alongside authored text. | Yes |
| Binding Format (valueFormat) | text | “” | Legacy display template when it contains an opening brace, such as {value}. | Yes |
| Preview Value (sampleValue) | text | “0” | Legacy binding previews can fall back to this sample; named templates can show a dash for unresolved values instead. This never initializes a runtime Variable. | Yes |
| Font (font) | thing:font | “” | Font resource assigned to this Text component; see the Text guide for font packaging and setup. | Yes |
| Font Family (fontFamily) | text | “Inter” | Style family name, which selects a family without packaging its font file. | Yes |
| Font Size (size) | number | 0.5 | Type size in the chosen presentation space. Minimum: 0.001 meters for world Text, or one screen pixel. | Yes |
| Font Weight (fontWeight) | text | “400” | Use normal, bold, or a multiple of 100 from 100 to 900 that the font provides. | Yes |
| Font Style (fontStyle) | text | “normal” | Styles are normal, italic, or oblique. Appearance depends on the selected font. | Yes |
| Letter Spacing (letterSpacing) | number | 0 | Extra spacing between characters, in the presentation space’s length units. | Yes |
| Line Spacing (lineSpacing) | number | 0 | Extra spacing between lines. Uses the same length units as Font Size. | Yes |
| Color (color) | color | “#ffffff” | Base text fill color, which character-range formatting can override for a selected range. | Yes |
| Alignment (align) | text | “left” | Values are left, center, or right within the text layout. | Yes |
| Text Bounds (textBoundsMode) | text | “auto” | Mode auto derives both rendered dimensions. Mode wrap uses authored width and derives height. | Yes |
| Text Rendering (textRenderMode) | text | “editor-default” | Choose editor-default, vector, or raster to set the text rendering mode. | Yes |
| Visible (visible) | boolean | true | Whether this Text component draws; Object activity and other components remain separate. | Yes |
| Local Position (transform.position) | vec3 | {“x”:0,“y”:0,“z”:0} | Local position relative to the Object’s fixed origin. Positioning can constrain this through another component. | Yes |
| Local Position X (transform.position.x) | number | 0 | Local X offset. | Yes |
| Local Position Y (transform.position.y) | number | 0 | Local offset on the Object’s Y axis. | Yes |
| Local Position Z (transform.position.z) | number | 0 | Offset along Z relative to the fixed Object origin. | Yes |
| Local Size (transform.size) | vec3 | {“x”:0.5,“y”:0.6,“z”:0} | Stored local extent, whose rendered width and height follow the Text Bounds mode and content. | Yes |
| Width (transform.size.x) | number | 0.5 | Authored width in wrap mode; auto mode derives the rendered width from content. | Yes |
| Height (transform.size.y) | number | 0.6 | Stored frame height; both bounds modes derive rendered height from content. | Yes |
| Depth (transform.size.z) | number | 0 | Stored local Z extent. | Yes |
| Local Rotation (transform.rotation) | vec3 | {“x”:0,“y”:0,“z”:0} | Local rotation around the project’s axes; each value uses degrees. | Yes |
| Local Rotation X (transform.rotation.x) | number | 0 | Rotation about the local X axis. | Yes |
| Local Rotation Y (transform.rotation.y) | number | 0 | Local Y rotation, in degrees. | Yes |
| Local Rotation Z (transform.rotation.z) | number | 0 | Rotation about Z; 2D Text uses this axis for planar rotation. | Yes |
Myth Engine Documentation
