UI Screen Space
Updated
Pins a panel to the screen as a HUD.
- Type
comp-ui-screen-space- Script class
UIScreenSpaceComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Panels and layout: 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 |
|---|---|---|
insetX |
- |
|
insetY |
- |
|
screenScale |
0. |
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 round minimapEvery frame a script redraws a round UI Drawing in the corner of the screen with a dot at the player's position on a 40 m map.
Watch the red dot on the minimap follow the amber player around the yard. Drag 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(UIScreenSpaceComponent); if (component) log(component.props);}