UI Label
Updated
A text label.
- Type
comp-ui-label- Script class
UILabelComponent- Per entity
- One
- Version
- 1.3.0
Read about it in Content: 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 |
|---|---|---|
borderRadius |
||
border |
0 ≤ x ≤ 16384 |
|
borderWidth |
||
borderWidth[] |
0 ≤ x ≤ 16384 |
|
fontSize |
0 ≤ x ≤ 4096 |
|
fontWeight |
1 ≤ x ≤ 1000 |
|
letterSpacing |
- |
|
lineHeight |
0 ≤ x ≤ 10 |
|
margin |
||
margin[] |
- |
|
maxHeight |
0 ≤ x ≤ 16384 |
|
maxWidth |
0 ≤ x ≤ 16384 |
|
minHeight |
0 ≤ x ≤ 16384 |
|
opacity |
0 ≤ x ≤ 1 |
|
padding |
||
padding[] |
0 ≤ x ≤ 16384 |
|
width |
0 ≤ x ≤ 16384 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
UILabel::press
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A long link that stays inside its panelA long link in a monospaced font wraps anywhere inside a 280 px width, and is clipped at 60 px high, so it never spills out of its panel.
See the long link wrap inside the panel. 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(UILabelComponent); if (component) log(component.props);}