UI Tooltip
Updated
Hover tooltip for any UI element.
- Type
comp-ui-tooltip- Script class
UITooltipComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Controls: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
delay |
0 ≤ x ≤ 60000 |
|
offset |
- |
|
padding |
||
padding[] |
0 ≤ x ≤ 16384 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
UITooltip::showUITooltip::hide
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
A File menu with three UI Menu Items, a tooltip added by a script, and an in-scene QWERTY UI Keyboard whose key presses play a click.
Rest the pointer on File to see its tooltip, press it and choose an entry: the log names it. Click the note field and press keys on the in-scene keyboard to hear them click. Drag outside the panel to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(UITooltipComponent); if (component) log(component.props);}