Toolbars

Description

Supported Script Types:

  • Interface Scripts
  • Client Entity Scripts
  • Avatar Scripts
The Toolbars API provides facilities to work with the system or other toolbar.

See also the Tablet API for use of the system tablet and toolbar in desktop and HMD modes.

Methods

Name Return Value Summary
getToolbar ToolbarProxy

Gets an instance of a toolbar. A new toolbar is created if one with the specified name doesn't already exist.

Signals

Name Summary
toolbarVisibleChanged

Triggered when the visibility of a toolbar changes.

Method Details

(static) getToolbar( name ) → {ToolbarProxy}
Returns: The toolbar instance.

Gets an instance of a toolbar. A new toolbar is created if one with the specified name doesn't already exist.

Parameters

Name Type Description
name string

A unique name that identifies the toolbar.

Signal Details

toolbarVisibleChanged( isVisible, toolbarName )
Returns: Signal

Triggered when the visibility of a toolbar changes.

Parameters

Name Type Description
isVisible boolean

true if the toolbar is visible, false if it is hidden.

toolbarName string

The name of the toolbar.

Example

Briefly hide the system toolbar.

Toolbars.toolbarVisibleChanged.connect(function(visible, name) {
    print("Toolbar " + name + " visible changed to " + visible);
});

var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
if (toolbar) {
    toolbar.writeProperty("visible", false);
    Script.setTimeout(function () {
        toolbar.writeProperty("visible", true);
    }, 2000);
}