Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / UIPanelComponent

Class: UIPanelComponent ​

Defined in: components/UIPanel.ts:33

A flat UI surface in the world — the backdrop menus and HUDs are built on.

Size is authored in METRES on the component, never via transform scale: the canvas texture is rasterised for the authored size, so scaling the entity would stretch texels into blur. Child widgets (text, buttons, toggles, sliders) are ordinary entities parented under the panel and placed with their transforms.

follow: "billboard" yaw-faces the camera each frame; for a wrist menu, parent the panel under an XR Interactor's Left/Right slot entity instead.

Extends ​

Constructors ​

Constructor ​

ts
new UIPanelComponent(options?): UIPanelComponent;

Defined in: components/UIPanel.ts:50

Parameters ​

ParameterType
options?UIPanelOptions

Returns ​

UIPanelComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
widthnumberFull width in metres.components/UIPanel.ts:35
heightnumberFull height in metres.components/UIPanel.ts:37
backgroundColorstring-components/UIPanel.ts:38
backgroundOpacitynumber0–1. Panels are usually slightly translucent in XR.components/UIPanel.ts:40
cornerRadiusnumberCorner radius in metres.components/UIPanel.ts:42
borderWidthnumberBorder thickness in metres; 0 disables the border.components/UIPanel.ts:44
borderColorstring-components/UIPanel.ts:45
pixelDensitynumberTexture density in px/metre, clamped 256–2048 at render time.components/UIPanel.ts:47
followUiFollowMode-components/UIPanel.ts:48