UI Element node

UI Text

Native text overlay rendered directly on the output viewport using AppKit's NSTextField. Unlike the Text as Image generator node, UI Text has zero GPU cost because it is not rendered through the Metal pipeline -- it is a native macOS text field composited on top of the viewport by the window manager. This makes it ideal for HUD displays, debug readouts, status labels, and interactive text input where pixel-perfect native font rendering and editing capabilities are needed.

Inputs

PortTypeDefault
EnableShows or hides the label. Off removes it from the render viewport completely, along with its hover and click feedback.booltrue
TextThe string drawn on screen. A connected cable always wins and blocks on-screen editing; with nothing connected the label keeps whatever was last typed or set here.stringHello
XHorizontal anchor in Grafit units, 0 being the centre of the viewport. Not clamped — beyond the edge the label simply sits offscreen.float0
YVertical anchor in Grafit units, 0 being the centre of the viewport. Not clamped; positive moves up, negative down.float0
SizeFont size in Grafit units, scaled to the render window — 0.05 is a comfortable caption. Not clamped, but 0 or less leaves nothing visible.float0.05
ColorText colour in its normal state. RGBA components run 0…1; alpha below 1 fades the label.color(1, 1, 1, 1)
Hover ColorColour while the pointer is over the text. Only visible when Interactive is on.color(0.6, 0.85, 1, 1)
Edit ColorColour while the text is being typed into on screen. Needs Interactive plus Editable, and nothing cabled into Text.color(1, 0.85, 0.3, 1)
H AlignWhich side of the anchor the text grows from — Left, Center or Right. Values outside those three centre it.int1
V AlignHow the text sits vertically on the anchor — Top, Middle or Bottom. Values outside those three use Middle.int1
Max WidthWrapping width in Grafit units. 0 means unlimited; above 0 the line wraps and the label never grows wider than this.float0
Max HeightHeight cap in Grafit units. 0 means unlimited; above 0 lines past the cap are cut away, with an ellipsis if Truncate is on.float0
Wrap ModeHow lines break — at any character, at word boundaries, or after your own Wrap Char. Values outside the three break at any character.int0
Wrap CharThe character a new line starts after when Wrap Mode is Custom; a comma neatly splits a list. Ignored in the other modes.string,
TruncateEnds the last visible line with an ellipsis when the text runs past Max Width or Max Height, instead of cutting mid-word.booltrue
InteractiveLets the label react to the mouse and feed the Hover, Click and Editing outputs. Off makes it pure display that clicks pass straight through.boolfalse
EditableAllows typing directly into the label in the render window. Takes effect only with Interactive on and nothing cabled into Text.boolfalse

Outputs

PortType
TextThe string drawn on screen. A connected cable always wins and blocks on-screen editing; with nothing connected the label keeps whatever was last typed or set here.string
Widthfloat
Heightfloat
Editingbool
Hoverbool
Clickbool

Alignment Modes

Alignment controls how the text is anchored relative to its X/Y position point.

Horizontal Alignment (H Align)

  • 0 — Left: The left edge of the text is placed at the X position. Text extends to the right.
  • 1 — Center: The text is centered horizontally on the X position. This is the default.
  • 2 — Right: The right edge of the text is placed at the X position. Text extends to the left.

Vertical Alignment (V Align)

  • 0 — Top: The top edge of the text is placed at the Y position. Text extends downward.
  • 1 — Middle: The text is centered vertically on the Y position. This is the default.
  • 2 — Bottom: The bottom edge of the text is placed at the Y position. Text extends upward.

Combining H Align and V Align lets you anchor the text to any of the nine standard reference points (top-left, top-center, top-right, middle-left, center, middle-right, bottom-left, bottom-center, bottom-right).

Interactive and Editable Modes

Display Only (default)

With both Interactive and Editable off, UI Text is a passive label. It displays text and reports its dimensions, but does not respond to any mouse interaction. The Hover, Click, and Editing outputs remain false.

Interactive Mode

Enable Interactive to make the text field respond to mouse events. The Hover output becomes true when the cursor is over the text, and Click outputs true on the frame when the user clicks it. This is useful for building clickable labels, buttons, or status indicators that trigger downstream logic.

Editable Mode

Enable both Interactive and Editable to allow the user to click the text in the output viewport and edit it directly. The cursor appears inside the text field, and every keystroke updates the Text output port in real time.

Editable mode has two requirements:

  1. Interactive must be enabled. Editable has no effect without Interactive.
  2. The Text input port must have no cable connected. When a cable is connected, the incoming data takes priority and editing is disabled, preventing conflicts between the data source and user input.

When the user finishes editing (clicks away or presses Enter/Tab), the final text is saved to the node's port value and persists with the project file.

Use Cases

  • HUD Displays: Overlay frame rate counters, timers, connection status, or any real-time data on the output viewport using zero GPU resources.
  • Debug Information: Display live node values, coordinates, or state variables during development. Connect any data source to the Text input and position the readout wherever it is convenient.
  • User Input Forms: Create on-screen text fields where users can type custom values that feed into the graph. Combine with Math Expression or JSON Parse to process user input.
  • Interactive Labels: Build clickable text elements that trigger actions elsewhere in the graph by connecting the Click output to downstream logic.
  • Data Dashboards: Arrange multiple UI Text nodes with different alignments and sizes to create information-dense overlays without any GPU texture cost.
  • Formatted Readouts: Use the Wrap Mode and Max Width settings to create multi-line text blocks with controlled layout, such as comma-separated sensor lists that auto-wrap at each delimiter.

Tips

  • Performance: Because UI Text is a native AppKit overlay, it has no GPU texture memory cost and no impact on Metal rendering performance. Use it freely for informational overlays.
  • Font selection: Open the Settings tab on the node to choose from all installed system fonts and font weights.
  • Multiline text: Insert newline characters in the Text input to create multi-line displays. You can also use Max Width with Wrap Mode to auto-wrap long strings.
  • Scaling behavior: The Size input is relative to the viewport height, so text maintains consistent proportions when the output window is resized.
  • Connecting data sources: When a cable is connected to the Text input, the incoming value overrides the stored text and editing is automatically disabled. Disconnect the cable to re-enable editing.
  • Measuring text: Use the Width and Height outputs to position other elements relative to the text. For example, connect Width to a Rectangle node to create a background that automatically matches the text size.
  • Custom wrap delimiters: Set Wrap Mode to 2 (Custom) and Wrap Char to any character (such as | or ;) to control exactly where long strings break into new lines.
  • UI Text vs. Text as Image: Use UI Text for informational overlays, debug readouts, and editable fields where native text rendering is preferred. Use Text as Image when you need the text rendered as a GPU texture for compositing with blend modes, masking, or shadow effects on the Canvas.

Open UI Text in the interactive catalog →

UI Text is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More UI Element nodes