Skip to content

@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 ​

ParameterTypeDescription
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 ​

PropertyModifierTypeDefault valueDescriptionDefined in
runsWhilePausedreadonlytruetrueKeep 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
redrawBudgetMspublicnumber4Canvas 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
maxRedrawsPerFramepublicnumber12-systems/UIPanelSystem.ts:194
statsreadonly{ redraws: number; deferred: number; skipped: number; }undefinedWidgets drawn (or not yet drawn) in total, for tests and profiling.systems/UIPanelSystem.ts:200
stats.redrawspublicnumber0-systems/UIPanelSystem.ts:200
stats.deferredpublicnumber0-systems/UIPanelSystem.ts:200
stats.skippedpublicnumber0-systems/UIPanelSystem.ts:200
uikitreadonlyUikitUiRenderer | nullundefinedDraws 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 ​

ParameterType
worldWorld
entityIdnumber

Returns ​

UiRendererStatus


update() ​

ts
update(world, deltaTime?): void;

Defined in: systems/UIPanelSystem.ts:259

Parameters ​

ParameterTypeDefault value
worldWorldundefined
deltaTimenumber0

Returns ​

void

Implementation of ​

EcsSystem.update


dispose() ​

ts
dispose(): void;

Defined in: systems/UIPanelSystem.ts:518

All GPU/canvas resources; call on world teardown.

Returns ​

void

Implementation of ​

EcsSystem.dispose