Realot StudioDocs
Components

SpeechBubble

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

View as Markdownllms.txt
ScopeThis page documents the SpeechBubble 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 → Speech Bubble, or Inspector → Add Component → Speech Bubble.

#What it does

Speech bubble UI attached to an entity, useful for dialogue and NPC callouts.

Component setup & editor toolsSpeechBubble provides an in-scene speech presentation attached to an entity.

#How to add and use SpeechBubble

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 SpeechBubble → 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 → SpeechBubble: configure its display properties; use the documented SpeechBubble API to change content at runtime.

#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
textstringCurrent bubble text.Hello!
visiblebooleanWhether visible.false
backgroundColorhex color stringBubble background.#ffffff
textColorhex color stringText color.#111111
borderColorhex color stringBorder color.#111111
borderWidthnumberBorder width.2
fontSizenumberFont size.20
fontFamilystringFont family.Arial
paddingnumberpx between the text and the bubble's edge12
cornerRadiusnumberCorner radius.10
maxWidthnumberpx — text wraps at this width220
offsetXnumberpx offset from this entity's own position0
offsetYnumbernegative = above the entity's head (typical)-60
tailDirectionstring"down" | "up" | "left" | "right" | "none" — which edge the pointer triangle sits on, pointing back at the entitydown
tailSizenumberTail size.14
hideTimernumberAuto-hide countdown in seconds, ticked down by SpeechBubbleSystem while visible; 0 or less means "stays visible until hidden manually" (see this.speechBubble.hide()).0

#Tuning behavior

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

SettingWhat changing it does
maxWidthHigher lets a line run longer before wrapping.
offsetYNegative values move the bubble upward from the entity in the default screen convention.
paddingHigher creates more interior space around text.
cornerRadiusHigher makes corners rounder.

#Script API

MemberKindDescription
backgroundColorProperty (read/write)Background color.
borderColorProperty (read/write)Border color.
borderWidthProperty (read/write)Border width.
cornerRadiusProperty (read/write)Corner radius.
fontFamilyProperty (read/write)Font family.
fontSizeProperty (read/write)Font size.
hide()MethodThe `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
maxWidthProperty (read/write)The `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
offsetXProperty (read/write)The `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
offsetYProperty (read/write)Vertical offset.
paddingProperty (read/write)Padding.
show(text, duration)MethodThe `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
tailDirectionProperty (read/write)The `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
tailSizeProperty (read/write)Tail size.
textProperty (read/write)The `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).
textColorProperty (read/write)Text color.
visibleProperty (read/write)The `this.speechBubble` sub-object exposed to user scripts (see scripting/ScriptAPI.js).

#Examples

js
this.speechBubble.show("Hello!", 2);
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.