Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
TheMenu
API provides access to the menu that is displayed at the top of the window on a user's desktop and in
the tablet when the "MENU" button is pressed.
Groupings
A "grouping" provides a way to group a set of menus or menu items together so that they can all be set visible or invisible as a group.
There is currently only one available group: "Developer"
. This grouping can be toggled in the
"Settings" menu.
If a menu item doesn't belong to a group, it is always displayed.
Methods
Name | Return Value | Summary |
---|---|---|
addMenu
|
None |
Adds a new top-level menu. |
addMenuItem
|
None |
Adds a new menu item to a menu. The menu item is specified using Menu.MenuItemProperties. |
addMenuItem
|
None |
Adds a new menu item to a menu. The new item is added at the end of the menu. |
addSeparator
|
None |
Adds a separator with an unclickable label below it. The separator will be placed at the bottom of the menu. To add a separator at a specific point in the menu, use Menu.addMenuItem with Menu.MenuItemProperties instead. |
isMenuEnabled
|
boolean |
Checks whether a menu or menu item is enabled. If disabled, the item is grayed out and unusable. Menus are enabled by default. |
isOptionChecked
|
boolean |
Checks whether a checkable menu item is checked. |
menuExists
|
boolean |
Checks whether a top-level menu exists. |
menuItemExists
|
boolean |
Checks whether a menu item exists. |
removeMenu
|
None |
Removes a top-level menu. |
removeMenuItem
|
None |
Removes a menu item from a menu. |
removeSeparator
|
None |
Removes a separator from a menu. |
setIsOptionChecked
|
None |
Sets a checkable menu item as checked or unchecked. |
setMenuEnabled
|
None |
Sets a menu or menu item to be enabled or disabled. If disabled, the item is grayed out and unusable. |
triggerOption
|
None |
Triggers a menu item as if the user clicked on it. |
Signals
Name | Summary |
---|---|
menuItemEvent
|
Triggered when a menu item is clicked or triggered by Menu.triggerOption. |
Type Definitions
MenuItemProperties Type: object |
||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A set of properties that can be passed to Menu.addMenuItem to create a new menu item.
If none of the properties, Properties
|
Method Details
(static) addMenu( menuName, groupingopt ) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new top-level menu. Parameters
Examples
|
(static) addMenuItem( properties ) | ||||||
---|---|---|---|---|---|---|
Adds a new menu item to a menu. The menu item is specified using Menu.MenuItemProperties. Parameters
Example
|
(static) addMenuItem( menuName, menuItem, shortcutKeyopt ) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new menu item to a menu. The new item is added at the end of the menu. Parameters
Example
|
(static) addSeparator( menuName, separatorName ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Adds a separator with an unclickable label below it. The separator will be placed at the bottom of the menu. To add a separator at a specific point in the menu, use Menu.addMenuItem with Menu.MenuItemProperties instead. Parameters
Example
|
(static) isMenuEnabled( menuName ) → {boolean}
Returns: true if the menu is enabled, otherwise false .
|
||||||
---|---|---|---|---|---|---|
Checks whether a menu or menu item is enabled. If disabled, the item is grayed out and unusable. Menus are enabled by default. Parameters
Example
|
(static) isOptionChecked( menuOption ) → {boolean}
Returns: true if the option is checked, otherwise false .
|
||||||
---|---|---|---|---|---|---|
Checks whether a checkable menu item is checked. Parameters
Example
|
Returns: true if the menu exists, otherwise false .
|
||||||
---|---|---|---|---|---|---|
Checks whether a top-level menu exists. Parameters
Example
|
Returns: true if the menu item exists, otherwise false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Checks whether a menu item exists. Parameters
Example
|
(static) removeMenu( menuName ) | ||||||
---|---|---|---|---|---|---|
Removes a top-level menu. Parameters
Example
|
(static) removeMenuItem( menuName, menuItem ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Removes a menu item from a menu. Parameters
Example
|
(static) removeSeparator( menuName, separatorName ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Removes a separator from a menu. Parameters
Example
|
(static) setIsOptionChecked( menuOption, isChecked ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a checkable menu item as checked or unchecked. Parameters
Example
|
(static) setMenuEnabled( menuName, isEnabled ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a menu or menu item to be enabled or disabled. If disabled, the item is grayed out and unusable. Parameters
Example
|
(static) triggerOption( menuOption ) | ||||||
---|---|---|---|---|---|---|
Triggers a menu item as if the user clicked on it. Parameters
Example
|
Signal Details
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a menu item is clicked or triggered by Menu.triggerOption. Parameters
Example
|