Skip to main content

Class: Controls

Defined in: src/interaction/Controls.ts:86

Controls panel for interactive scene manipulation. Creates a DOM-based UI overlay positioned over the scene canvas.

Extended by​

Constructors​

Constructor​

new Controls(scene, options): Controls

Defined in: src/interaction/Controls.ts:96

Create a new Controls panel.

Parameters​

scene​

Scene

The scene to attach controls to

options​

ControlsOptions = {}

Configuration options

Returns​

Controls

Properties​

_options​

protected _options: Required<ControlsOptions>

Defined in: src/interaction/Controls.ts:89


_panel​

protected _panel: HTMLElement

Defined in: src/interaction/Controls.ts:88


_scene​

protected _scene: Scene

Defined in: src/interaction/Controls.ts:87

Accessors​

panel​

Get Signature​

get panel(): HTMLElement

Defined in: src/interaction/Controls.ts:109

Get the underlying HTML panel element.

Returns​

HTMLElement


scene​

Get Signature​

get scene(): Scene

Defined in: src/interaction/Controls.ts:116

Get the scene this controls panel is attached to.

Returns​

Scene

Methods​

_getAccentColor()​

protected _getAccentColor(): string

Defined in: src/interaction/Controls.ts:176

Get the accent color based on theme.

Returns​

string


_getBorderColor()​

protected _getBorderColor(): string

Defined in: src/interaction/Controls.ts:190

Get the border color based on theme.

Returns​

string


_getHoverColor()​

protected _getHoverColor(): string

Defined in: src/interaction/Controls.ts:183

Get the hover color based on theme.

Returns​

string


addButton()​

addButton(config): HTMLElement

Defined in: src/interaction/Controls.ts:318

Add a button control.

Parameters​

config​

ButtonConfig

Button configuration

Returns​

HTMLElement

The created button element


addCheckbox()​

addCheckbox(config): HTMLElement

Defined in: src/interaction/Controls.ts:366

Add a checkbox control.

Parameters​

config​

CheckboxConfig

Checkbox configuration

Returns​

HTMLElement

The created wrapper element


addColorPicker()​

addColorPicker(config): HTMLElement

Defined in: src/interaction/Controls.ts:447

Add a color picker control.

Parameters​

config​

ColorPickerConfig

Color picker configuration

Returns​

HTMLElement

The created wrapper element


addLabel()​

addLabel(text): HTMLElement

Defined in: src/interaction/Controls.ts:566

Add a section label.

Parameters​

text​

string

Label text

Returns​

HTMLElement

The created label element


addSeparator()​

addSeparator(): void

Defined in: src/interaction/Controls.ts:551

Add a horizontal separator line.

Returns​

void


addSlider()​

addSlider(config): HTMLElement

Defined in: src/interaction/Controls.ts:199

Add a slider control.

Parameters​

config​

SliderConfig

Slider configuration

Returns​

HTMLElement

The created wrapper element


dispose()​

dispose(): void

Defined in: src/interaction/Controls.ts:617

Clean up and remove the controls panel from the DOM.

Returns​

void


hide()​

hide(): void

Defined in: src/interaction/Controls.ts:592

Hide the controls panel.

Returns​

void


isVisible()​

isVisible(): boolean

Defined in: src/interaction/Controls.ts:610

Check if the controls panel is visible.

Returns​

boolean


show()​

show(): void

Defined in: src/interaction/Controls.ts:585

Show the controls panel.

Returns​

void


toggle()​

toggle(): void

Defined in: src/interaction/Controls.ts:599

Toggle the controls panel visibility.

Returns​

void