The data structure for a single tool in the SceneControl#tools record.

interface SceneControlTool {
    active?: boolean;
    button?: boolean;
    icon: string;
    name: string;
    onChange?: (event: Event, active: boolean) => void;
    order: number;
    title: string;
    toggle?: boolean;
    toolclip?: ToolclipConfiguration;
    visible?: boolean;
}

Properties

active?: boolean

Is the tool the currently the active one? Not applicable to toggles or buttons.

button?: boolean

Is the tool a "button" in the sense of immediately resolving on click without becoming the active tool?

icon: string

One or more icon classes for the tool, typically Font Awesome classes such as "fa-solid fa-face-smile"

name: string

An identifier for the tool, unique among the tools of its SceneControl

onChange?: (event: Event, active: boolean) => void

A callback invoked when the tool is activated or deactivated

order: number

An integer indicating the tool's order, with 0 being at the top

title: string

A title for the tool: can be a localization path

toggle?: boolean

Is the tool an on-or-off toggle?

Configuration for rendering the tool's toolclip

visible?: boolean

Whether the tool should be visible to the current User