MenuOption class
📖 Description
The MenuOption
class is an abstract class for creating menu option controls for the Menu
class.
🆕 constructor
Creates a new MenuOption
instance.
Signature
constructor(
disabled: boolean,
interactable: boolean
): MenuOption
Parameters
Name | Type | Optional | Description |
---|---|---|---|
disabled | boolean | No | Specifies the disabled state. |
interactable | boolean | No | Specifies if the option is interactable or static. |
Return value
Returns a reference to the new MenuOption
instance.
🗃️ Fields
🏷️ canOpen
Retrieves if the option can be opened.
Type
boolean
🏷️ closeOnTap
Retrieves if the menu should be closed when the option is tapped.
Type
boolean
🏷️ isDisabled
Sets or retrieves if the option is disabled.
Type
boolean
🏷️ isHovered
Sets or retrieves if the option is hovered.
Type
boolean
🏷️ isOpen
Retrieves if an option is opened.
Type
boolean
🏷️ isSelected
Sets or retrieves if the option is in the selected state.
Type
boolean
🏷️ menu
Retrieves a reference to the menu.
Type
Menu
| undefined
📢 Events
🔔 onClose
Fired when an option is closed.
Signature
(option: MenuOption, animate: boolean) => void
Parameters
Name | Type | Optional | Description |
---|---|---|---|
option | MenuOption | No | Reference to the option. |
animate | boolean | No | Specifies if an animation should be used. |
🔔 onDestroy
Fired when an option is destroyed.
Signature
(option: MenuOption) => void
Parameters
Name | Type | Optional | Description |
---|---|---|---|
option | MenuOption | No | Reference to the option. |
🔔 onOpen
Fired when an option is opened.
Signature
(option: MenuOption) => void
Parameters
Name | Type | Optional | Description |
---|---|---|---|
option | MenuOption | No | Reference to the option. |
🔔 onRemove
Fired when an option is removed.
Signature
(option: MenuOption) => void
Parameters
Name | Type | Optional | Description |
---|---|---|---|
option | MenuOption | No | Reference to the option. |
🔔 onTap
Fired when an option is tapped.
Signature
(option: MenuOption) => void
Parameters
Name | Type | Optional | Description |
---|---|---|---|
option | MenuOption | No | Reference to the option. |