UI Avatar
Updated
Round profile picture with a status dot.
- Type
comp-ui-avatar- Script class
UIAvatarComponent- 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 |
|---|---|---|
borderWidth |
||
borderWidth[] |
0 ≤ x ≤ 16384 |
|
initials |
0 ≤ x ≤ 4096 |
|
margin |
||
margin[] |
- |
|
padding |
||
padding[] |
0 ≤ x ≤ 16384 |
|
size |
0 ≤ x ≤ 16384 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
UIAvatar::press
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
A profile card built from a UI Avatar with initials and a status dot, a UI Spacer that pushes the level badge right, and UI Dividers between the stats. Pressing the avatar cycles the status.
Press the avatar to cycle Online, Away and Busy: the status dot and the label change together. 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(UIAvatarComponent); if (component) log(component.props);}