785 B
785 B
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 |
Functions
| Method | Returns | Description |
|---|---|---|
| Menu:setItems | Menu | Sets the menu items and calculates total width |
Menu:setItems(items)
Sets the menu items
Parameters
itemstable[] List of items with {text, separator, callback, foreground, background} properties
Returns
MenuselfThe Menu instance
Usage
menu:setItems({{text="File"}, {separator=true}, {text="Edit"}})