@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / UIPanelSystem
Class: UIPanelSystem ​
Defined in: systems/UIPanelSystem.ts:167
Implements ​
Constructors ​
Constructor ​
ts
new UIPanelSystem(options?): UIPanelSystem;Defined in: systems/UIPanelSystem.ts:230
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options? | { createCanvas?: () => UiCanvasLike; uikit?: | false | UikitUiRenderer | (() => Promise<__module>); } | - |
options.createCanvas? | () => UiCanvasLike | - |
options.uikit? | | false | UikitUiRenderer | (() => Promise<__module>) | false keeps every tree on canvas; a function loads uikit (tests). |
Returns ​
UIPanelSystem
Properties ​
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
runsWhilePaused | readonly | true | true | Keep ticking while the world is paused. Leave it unset for anything that moves the game on: such a system stops at world.pause() and picks up where it was at world.resume(). | systems/UIPanelSystem.ts:168 |
redrawBudgetMs | public | number | 4 | Canvas redraws allowed in one frame, by time and by count. A redraw is 1-3 ms on a headset plus a texture upload when it draws, so a screen change that retexts 60 widgets at once was a 10-16 ms spike; past the budget the rest wait for the next frames (one always goes through). Infinity turns it off. Off in the editor, where an edit should show at once. | systems/UIPanelSystem.ts:193 |
maxRedrawsPerFrame | public | number | 12 | - | systems/UIPanelSystem.ts:194 |
stats | readonly | { redraws: number; deferred: number; skipped: number; } | undefined | Widgets drawn (or not yet drawn) in total, for tests and profiling. | systems/UIPanelSystem.ts:200 |
stats.redraws | public | number | 0 | - | systems/UIPanelSystem.ts:200 |
stats.deferred | public | number | 0 | - | systems/UIPanelSystem.ts:200 |
stats.skipped | public | number | 0 | - | systems/UIPanelSystem.ts:200 |
uikit | readonly | UikitUiRenderer | null | undefined | Draws the trees that resolve to uikit (see UIPanelComponent.renderer); null when this system was made with uikit: false. | systems/UIPanelSystem.ts:225 |
Methods ​
rendererOf() ​
ts
rendererOf(world, entityId): UiRendererStatus;Defined in: systems/UIPanelSystem.ts:254
What draws the widget tree this entity belongs to, and, when it wanted uikit but got canvas, why. For the editor's inspector.
Parameters ​
| Parameter | Type |
|---|---|
world | World |
entityId | number |
Returns ​
update() ​
ts
update(world, deltaTime?): void;Defined in: systems/UIPanelSystem.ts:259
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
world | World | undefined |
deltaTime | number | 0 |
Returns ​
void
Implementation of ​
dispose() ​
ts
dispose(): void;Defined in: systems/UIPanelSystem.ts:518
All GPU/canvas resources; call on world teardown.
Returns ​
void

