LayoutBuilder
File: Rhapsodist/Core/Includes/LayoutBuilder.js · Namespace: LayoutBuilder
Overview
LayoutBuilder builds the shell UI from a declarative layout tree. ShellLayout.js is its only caller: it declares the entire shell component tree as one nested JSON literal, hands it to LayoutBuilder.add(), then calls LayoutBuilder.process(), which creates or updates each component and applies its declared properties.
process() only runs inside the HISE IDE (Engine.isHISE()), in an exported plugin the shell components already exist from the last IDE-built state and are just fetched.
It also does nothing if a project-level freezeUi variable is truthy. Set freezeUi = true during UI development to stop the layout rebuilding, and any manual IDE tweaks being overwritten, on every reload. Remove freezeUi before packaging.
Re-running the layout over an existing component never overwrites colours (left to StyleHandler) or text/border properties you’ve already customised by hand.
Usage
LayoutBuilder has no entry point for an expansion to call, ShellLayout.js is its only caller.
Internal Reference
| Function | Description | Returns |
|---|---|---|
addComponent(id: string, properties: JSON) | Creates the component if it doesn’t already exist (based on properties.type), then applies properties to it, skipping colours and text/border properties on an existing component. | object |
clearComponentColours(component: ScriptObject) | Zeroes a newly created component’s colour properties so it picks up StyleHandler’s palette instead of HISE’s defaults. | — |