UIControlsBuilder - Creates and manages UI button controls
Example usage:
const builder = new UIControlsBuilder();const controls = builder .setContainer({ position: 'top-left', direction: 'vertical' }) .addButton({ id: 'home', icon: 'bi-house', title: 'Reset camera view', onClick: () => this.resetCamera() }) .addButton({ id: 'screenshot', icon: 'bi-camera', title: 'Take screenshot', onClick: () => this.takeScreenshot() }) .build();// Attach to mount pointmount.appendChild(controls.container);// Access individual buttonsconst homeButton = controls.buttons.get('home'); Copy
const builder = new UIControlsBuilder();const controls = builder .setContainer({ position: 'top-left', direction: 'vertical' }) .addButton({ id: 'home', icon: 'bi-house', title: 'Reset camera view', onClick: () => this.resetCamera() }) .addButton({ id: 'screenshot', icon: 'bi-camera', title: 'Take screenshot', onClick: () => this.takeScreenshot() }) .build();// Attach to mount pointmount.appendChild(controls.container);// Access individual buttonsconst homeButton = controls.buttons.get('home');
Configure the button container
Add a button to the control panel
Add multiple buttons at once
Build the UI controls and return the result
Private
Create the container element
Get Bootstrap positioning classes based on position config
Create a single button element
Reset the builder to initial state
UIControlsBuilder - Creates and manages UI button controls
Example usage: