Menu
This is the menu class. It provides a horizontal menu bar with selectable items. Menu items are displayed in a single row and can have custom colors and callbacks.
Extends: List
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| separatorColor | color | gray | The color used for separator items in the menu |
| spacing | number | 0 | The number of spaces between menu items |
| horizontalOffset | number | 0 | Current horizontal scroll offset |
| maxWidth | number | nil | Maximum width before scrolling is enabled (nil = auto-size to items) |
Functions
| Method | Returns | Description |
|---|---|---|
| Menu:getTotalWidth | number | Calculates total width of menu items |
Menu:getTotalWidth()
Calculates the total width of all menu items with spacing
Returns
numbertotalWidthThe total width of all items