Skip to content

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

PropertyTypeDefaultDescription
separatorColorcolorgrayThe color used for separator items in the menu
spacingnumber0The number of spaces between menu items
horizontalOffsetnumber0Current horizontal scroll offset
maxWidthnumbernilMaximum width before scrolling is enabled (nil = auto-size to items)

Functions

MethodReturnsDescription
Menu:getTotalWidthnumberCalculates total width of menu items

Calculates the total width of all menu items with spacing

Returns

  • number totalWidth The total width of all items

Released under the MIT License.